• 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: Simple instance [[alloc] init] question.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple instance [[alloc] init] question.


  • Subject: Re: Simple instance [[alloc] init] question.
  • From: Scott Anguish <email@hidden>
  • Date: Mon, 30 Aug 2010 22:59:18 -0400

Assuming his @property was supposed to be (nonatomic,retain)

We did the release explicitly when doing some sample code on iPhone. We didn’t want the autorelease pool to grow.

IRMSerialDetailsDO *mySerialIDDO = [[IRMSerialDetailsDO alloc] init];
self.serialIDDO = mySerialIDDO;
[mySerialIDDO release];

So this wasn’t that far off.

Not sure if it’s still the same suggestion.

Oh David...?


On Aug 30, 2010, at 10:01 PM, Charles Srstka wrote:

> On Aug 30, 2010, at 7:23 PM, Frederick C. Lee wrote:
>
>> // 1)
>> self.serialIDs = [[IRMSerialDetailsDO alloc] init];
>
> This is, as mentioned, a leak, although if performance is not an issue, you can still have the simplicity:
>
> self.serialIDs = [[[IRMSerialDetailsDO alloc] init] autorelease];

_______________________________________________

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: 
 >Simple instance [[alloc] init] question. (From: "Frederick C. Lee" <email@hidden>)
 >Re: Simple instance [[alloc] init] question. (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: zib works in Dubug, not in Release
  • Next by Date: Re: Simple instance [[alloc] init] question.
  • Previous by thread: Re: Simple instance [[alloc] init] question.
  • Next by thread: zib works in Dubug, not in Release
  • Index(es):
    • Date
    • Thread