I want to use getter for lazy instantiation and leave the default installer.
Is @synthesize necessary?
Why?
@interface Foo() @property (strong, nonatomic) NSObject *bar; @end @implementation Foo - (NSObject *)bar { if(!_bar) _bar = [[NSObject alloc] init]; return _bar; } @end
Update: I changed the name of the variable and class because it was confusing. From decks and cards to Foo and bar.
objective-c getter-setter xcode5 synthesize
Greg leszek
source share