Tutorial by Examples

Assume we need to add an NSString object to SomeClass (we cant subclass). In this example we not only create an associated object but also wrap it in a computed property in a category for extra neatness #import <objc/runtime.h> @interface SomeClass (MyCategory) // This is the property wr...

Page 1 of 1