-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Objective C Memory Management Essentials
By :

Normally, KVC looks up for a property key and acts only after the property key is found. The other approach is about acting on an object's property in the lookup process. There is a lookup method in Objective-C core and its keys are used as selectors.
The following line of code is how you implement this lookup method:
objc_msgSend(myObject, mySetterSelector, myValue);
This method is very similar to the manual implementation of the instance variable's setter, but instead of using the key to form a selector to do a look up, it uses the selector itself as the key.
It's possible to get and set non-object data.
From all approaches that handles methods, this is the fastest one.
You need different selectors for get and set
Since selectors are not objects, it's impossible to store directly in NSArray
and NSDictionary
. Instead, you can use NSValue
or Core Foundation
Change the font size
Change margin width
Change background colour