Which is the best way to handle creating an object to live in a retained property? I've included several examples.
Assume the property is:
@property (nonatomic, retain) myProperty;
@synthesize myProperty = _myProperty;
Option 1:
self.myProperty = [[[MyClass alloc] init] autorelease];
Option 2:
self.myProperty = [[MyClass alloc] init];
[self.myProperty release];
Option 3:
_myProperty = [[MyClass alloc] init];
Option 4:
MyClass *property = [[MyClass alloc] init];
self.myProperty = property;
[property release];