where does one do the autorelease?
where does one do the autorelease?
- Subject: where does one do the autorelease?
- From: John Spicer <email@hidden>
- Date: Thu, 22 Jul 2004 13:30:01 -0500
Here's some code, it's to take care of the instance if the passed in
string is actually a null class (from a database, for example).
Where does one put the autorelease in the else clause, before or after
the init? I think after but before I change lots of code I'd like to be
right ;)
- (void) setCOMMENT : (NSString *) str
{
if ([str isKindOfClass:[NSString class]])
{
[COMMENT autorelease];
COMMENT = [str copy];
}
else
{
COMMENT = [[NSString alloc] initWithString:@""];
[COMMENT autorelease];
}
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.