Re: Accessors Question
Re: Accessors Question
- Subject: Re: Accessors Question
- From: Andy Lee <email@hidden>
- Date: Thu, 12 Jun 2008 13:33:00 -0400
On Jun 12, 2008, at 1:21 PM, Jeff LaMarche wrote:
Lately, I've started to see accessors of the following sort:
- (NSString *)foo
{
return [[foo retain] autorelease];
}
I believe this is in case of something like this:
NSString *myFoo = [myObject foo];
// ... stuff that causes myObject to be deallocated ...
NSLog(@"%@", myFoo); // <--- myFoo might be invalid
I definitely saw this pattern mentioned before GC, so it doesn't have
to do with that.
--Andy
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden