Simple instance [[alloc] init] question.
Simple instance [[alloc] init] question.
- Subject: Simple instance [[alloc] init] question.
- From: "Frederick C. Lee" <email@hidden>
- Date: Mon, 30 Aug 2010 17:23:23 -0700
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 (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