The response is posted by Alex Rozanski in a Stackoverflow thread
Some accessors are created dynamically at runtime, such as certain ones used in CoreData's NSManagedObject class. If you want to declare and use properties for these cases, but want to avoid warnings about methods missing at compile time, you can use the @dynamic directive instead of @synthesize....Using the @dynamic directive essentially tells the compiler "don't worry about it, a method is on the way."
The
@synthesize
directive, on the other hand, generates the accessor methods for you at compile time (although as noted in the "Mixing Synthesized and Custom Accessors" section it is flexible and does not generate methods for you if either are implemented).
Nessun commento:
Posta un commento