If I have an object called Catalog that has a (nonatomic, retain) attrib called "title". I do "[attrib release];" in the dealloc method of Catalog:
-(void)dealloc {
[title release], title = nil;
[super dealloc];
}
Later I do "Catalog *c = [Catalog new];".
Compare 1:
dto.title = [[NSString alloc] initWithFormat:@"...", ...];
and 2:
dto.title = [NSString stringWithFormat:@"...",...];
It is common sense to release all attribs of an object in the dealloc method, but what if I pass along an accessor method (that already has an autorelease)? Should I release or not release the accessor'd attribute in dealloc then?