a bit related to In Objective-C MRR, if foo is a retain property, then self.foo = [[Foo alloc] init] will need to be released immediately?
suppose you have
@property (nonatomic, readwrite, retain) NSObject *foo;
In this case
- (instancetype)initWithSomeObject:(NSObject)foo
{
self = [super init];
if (self != nil) {
_foo = foo;
}
}
would foo correctly get autoincremented as retain property attribute suggests it should?
I initially wrote this as self.foo = foo; but for some reason folks on the team use the compact syntax that seemed more fitting in MRC times to avoid superfluous release for a n object newly created in the init context.
2