Re: Small question pertaining to memory management
Re: Small question pertaining to memory management
- Subject: Re: Small question pertaining to memory management
- From: Sherm Pendley <email@hidden>
- Date: Sun, 24 Jan 2010 10:57:15 -0500
On Sun, Jan 24, 2010 at 9:57 AM, Michael de Haan <email@hidden> wrote:
> No...it's not a question about "the rules"!
Yes it is. :-)
> On page 271 in Hillegass, (Typing tutor) a setter is defined thus:
>
>
> -(void) setString:(NSString *) c
> {
> c = [c copy];
> [string release];
> string = c;
> }
> My question pertains the **original** object , which was referenced/passed
> to the method "setString".
>
> Can I **assume** that the originally referenced object is released in an
> appropriate way, once the copy is created and assigned to "c"?
The same rules apply to arguments as to anything else. You didn't
create it with one of the methods that imply ownership. Nor did you
retain it. So, you're not responsible for releasing it.
What does this have to do with Xcode, by the way?
sherm--
--
Cocoa programming in Perl:
http://www.camelbones.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden