• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: memory management
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >memory management (From: Daniel Richman <email@hidden>)

  • Prev by Date: Re: memory management
  • Next by Date: Unable to detect a NSRightMouseDown event using a three-button mouse?
  • Previous by thread: Re: memory management
  • Next by thread: Re: memory management
  • Index(es):
    • Date
    • Thread