Re: When does an object own its instance variable?
Re: When does an object own its instance variable?
- Subject: Re: When does an object own its instance variable?
- From: j o a r <email@hidden>
- Date: Fri, 17 Aug 2007 13:17:22 +0200
On 17 aug 2007, at 12.26, Tony Wroblewski wrote:
I would do something like the following:
-(void) setName:(NSString *)theName
{
if (name)
[name release];
name = [theName copy];
}
This pattern is not always safe to use as it can crash if you were to
call that method with the same object twice. It's typically better to
point to the official documentation, and then follow up with whatever
clarifications that might be needed in some particular case.
<http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/
index.html>
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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