Today I rewrote the description method (NSString *), and I wondered if this line should be auto-updated before it is returned.
-(NSString*)description { NSMutableString *response = [[NSMutableString alloc] init]; // perform appends return [response autorelease]; }
Yes, according to the ownership rule, your function should not delegate ownership of the returned string to the caller.
Yes. Any method that does not start with alloc , new , copy or mutableCopy should not return a stored object. See Memory Management Rules
alloc
new
copy
mutableCopy