Re: Simple instance [[alloc] init] question.
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