tells the compiler that the getter and setter methods are implemented not by the class itself but somewhere else (like the superclass will be provided at runtime). Used in CoreData
Uses for @dynamic are e.g. with subclasses of NSManagedObject (CoreData) or when you want to create an outlet for a property defined by a superclass that was not defined as an outlet.
Super class:
@property (nonatomic, retain) NSButton *someButton;
...
@synthesize someButton;
Subclass:
@property (nonatomic, retain) IBOutlet NSButton *someButton;
...
@dynamic someButton;
I am so happy to read this. This is the kind of manual that needs to be given and not the random misinformation that's at the other blogs. Thanks for sharing this.
ReplyDeletePicgrant Singapore 2014