Objective-C: `@synthesize fooBar;` vs. `@synthesize fooBar=_fooBar;` [duplicate]

@synthesize fooBar; creates accessors for the property fooBar using an instance variable with the same name for storage, while the =_fooBar tells the compiler to use the instance variable named _fooBar as storage instead. You don’t need to use the =... if you have your instance variables and properties identically named, and you do otherwise.

Leave a Comment