#1 is a leak.

(I'm assuming that "release" is supposed to be "retain" in the property 
declaration)

Brian

On Aug 30, 2010, at 8:23 PM, Frederick C. Lee wrote:

> Which is the preferred method of object allocation & initialization?
> 
> <header file>.h
> @property(nonatomic, release) IRMSerialDetailsDO *serialIDs;
> ...
> <body>.m
> @synthesize mySerialIDDO
> 
> ...
> // 1)
> self.serialIDs = [[IRMSerialDetailsDO alloc] init];
> 
> or...
> 
> // 2)
> IRMSerialDetailsDO *mySerialIDDO = [[IRMSerialDetailsDO alloc] init];
> self.serialIDDO = mySerialIDDO;
> [mySerialIDDO release];
> 
> 
> I would assume #1 is the simplest, but I see a lot of #2 .
> 
> Thoughts?
> 
> Ric.
> _______________________________________________
> 
> 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/brianslick%40mac.com
> 
> This email sent to briansl...@mac.com

_______________________________________________

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