There are some errors when writing the OC code look at your friends in the usual attention to write a small error I will continue to summarize
1.
[Nstimer scheduledtimerwithtimeinterval:1 target:self selector: @selector (timesaction:) Userinfo:nil Repeats:yes]; This is a timer initialization method but remember the usual when writing, when the timer method may be timesaction: in the: Lost at this time Xcode will not error, but the compiler will not be reported when the initialization timer method instead of stopping in
[[Nsrunloop Currentrunloop]run];
Unrecognized selector sent to instance 0x100202c60 explained that he did not find a matching method.
2. When using KVO, it is not possible to reduce the attribute value with a--because in this method when writing the listener
[_children addobserver:self forkeypath:@ "Happy" options:nskeyvalueobservingoptionnew | Nskeyvalueobservingoptionold context:@ "Hahahah"]; on which he returned the dictionary key to old and new on the other, if it is a--it will be the value of the original value assigned to old and new and then the value will be unchanged. Because he hears the value and the original value has not changed, if the value has not changed, then will not carry on the method of the reaction, note: a--is the first value and then self-reduction.
3. How do you do it? The value of an int is divided into hundred
NSLog (@ "The child's cleanliness%0.1f%%", tim/100.0*100); In this%0.1f%% ", tim/100.0*100 the first percent is a must write the mark can not tube, tim/100.0* 100 This allows one decimal to be left at the end of the calculated number.
iOS usual note 1