if I have a property such as
@property (nonatomic, retain) NSArray *myArray;
and then I set it as follows
[self setMyArray:[[NSArray alloc]init]];
do I have a retain count of 2?
When I release it in my dealloc method will there still be a retain count of 1?
You do in fact have one too many references if you set the property with just the return of [[NSArray alloc] init].
You can use [self setMyArray:[NSArray array]] to avoid that as the ‘array’ method returns an auto-released object.
Or…
… if you’d prefer not to use an auto-released object.