Re: memory management
Re: memory management
- Subject: Re: memory management
- From: "Clark Cox" <email@hidden>
- Date: Sat, 26 Jul 2008 17:54:46 -0700
On Sat, Jul 26, 2008 at 4:44 PM, Daniel Richman
<email@hidden> wrote:
> Now let us suppose that I have a class Foo with instance variables V1 and V2
> (ints). If I were to create a class method:
>
> + (Foo *)fooWithV1:(int)a V2:(int)b {
>
> Foo *newFoo = [[Foo alloc] init];
> [newFoo setV1:a];
> [newFoo setV2:b];
>
> return newFoo;
> }
>
> then I should also put, just before [return newFoo];, [newFoo autorelease];.
Yes.
--
Clark S. Cox III
email@hidden
_______________________________________________
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