I read in the apple documentation about copyWithZone :
"The returned object is implicitly retained by the sender, who is responsible for releasing it".
So if I write this :
- (id)copyWithZone:(NSZone *)zone {
MyObject* obj = [[[[self class] allocWithZone:zone] init] autorelease];
[obj fillTheObj];
return obj;
}
and I call :
MyStuff* obj = [varobj copy];
will obj
be retained? What about the retain count if I don't set autorelease?