I know that the correct convention to assign values in a class's method is to not use the setter version.
Given you have an init method like this:
// Class header
@property (nonatomic, weak) id <DelegateType> delegate;
@property (nonatomic, strong) NSString *stringData;
@synthesize delegate = _delegate;
@synthesize stringData = _stringData;
- (id)initWithParams:(NSString *)aString delegate:(id<DelegateType>)aDelegate
{
// initialization happens here
}
Pre-ARC, you would ensure the correct retain policy with:
stringData = [aString retain];
self.delegate = aDelegate;
With ARC, how would do the assignment and ensure that the ivars are not released too early?
Because you don't know what kind of work maybe happening behind the scenes in the case of a setter override, I was under the impression that you can't do:
self.stringData = aString
What is the correct init pattern?