Apple's documentation describes how KVO is implemented internally.
Up vote 2 down vote favorite share g+ share fb share tw.
Because it's dangerous using framework which I can't understand its internal behavior, I want to know its behavior. Currently, I cannot understand how it work without any method definitions. Cocoa key-value-observing foundation internals link|improve this question edited Mar 22 '11 at 5:04?5,89841220 asked Mar 22 '11 at 4:34Eonil7,4112683 77% accept rate.
Apple's documentation describes how KVO is implemented internally. The gist of it is that when you register an observer on an object, the framework dynamically creates a sub-class of the object's original class and adjusts the object to appear as a subclass of this new dynamic class. You can see this if you inspect an object in the debugger after it has had an observer registered.
This new class intercepts messages to the object and inspects them for those matching certain patterns (such as the getters, setters, and collection access).
In a nutshell: Objective-C 2.0's @property declaration creates accessor methods for the named property, so there are method definitions. @property is just a shorthand way to define them which avoids a lot of repetitious boilerplate code. When you observe a property, a private subclass is created which implements accessors that call the appropriate notification methods before and after changing the property value.
A technique known as "isa swizzling" is then used to change the class of the observed object.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.