Re: Are these the same and correct?
Re: Are these the same and correct?
- Subject: Re: Are these the same and correct?
- From: Sherm Pendley <email@hidden>
- Date: Mon, 14 Nov 2005 14:02:22 -0500
On Nov 14, 2005, at 1:43 PM, Brian O'Brien wrote:
NSNumber *n = [[[NSNumber alloc] initWithShort:val] autorelease];
and
NSNumber *n = [NSNumber numberWithShort:val];
They're *very* similar; in neither case are you responsible for
releasing n later.
But, as a matter of internal implementation details, there's no
guarantee that n is autoreleased in the second case, although it
quite often will be.
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden