Re: new class
Re: new class
- Subject: Re: new class
- From: Shawn Erickson <email@hidden>
- Date: Fri, 21 Sep 2007 07:17:09 -0700
On Sep 21, 2007, at 4:53 AM, Alan Smith wrote:
Hi,
You retain an object when you want to have reference to it later. For
example, to set an ivar you do something like this:
- (void)setString:(NSString*)string
{
[_string release];
_string = [string retain];
}
Hope this helps and isn't confusing.
All fine and good unless string and _string are the same object. :)
Review...
<http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/
Articles/mmAccessorMethods.html#//apple_ref/doc/uid/TP40003539>
The "zero" rule of Cocoa memory management.... the rules are easy
believing the rules are that easy is the hard part.
-Shawn
_______________________________________________
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