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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to