Re: simple question about passing around pointers to objects
Re: simple question about passing around pointers to objects
- Subject: Re: simple question about passing around pointers to objects
- From: Graham Cox <email@hidden>
- Date: Sat, 28 Jun 2008 14:29:07 +1000
Actually, in the context of this:
NSArray *a = [NSArray arrayFromObjects:someObject, anotherObject, nil];
you would do nothing, since that method returns an autoreleased
NSAarray already.
But in a situation where you alloc/inited an object, you would
autorelease before returning it.
G.
On 28 Jun 2008, at 2:21 pm, Graham Cox wrote:
Then you'd be wrong. You should use [a autorelease];
G.
On 28 Jun 2008, at 10:19 am, Daniel Richman wrote:
I would use [a retain];
_______________________________________________
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
_______________________________________________
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