Google News
logo
Swift - Interview Questions
What is the difference between @synthesize and @dynamic in Objective –C?
@synthesize : It is used to generate a getter and setter method for the property.
@property (nonatomic, retain) NSButton *someButton1;

…

@synthesize someButton1;
 
 
@dynamic : It will inform the compiler that getter and setter are implemented at some other place.
@property (nonatomic, retain) IBOutlet NSButton *someButton1;

…

@dynamic someButton1;
Advertisement