• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Are these the same and correct?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Are these the same and correct?
      • From: Uli Kusterer <email@hidden>
    • Re: Are these the same and correct?
      • From: Chris Hanson <email@hidden>
References: 
 >Are these the same and correct? (From: "Brian O'Brien" <email@hidden>)

  • Prev by Date: Re: awakeFromInsert is not called
  • Next by Date: Re: Are these the same and correct?
  • Previous by thread: Re: Are these the same and correct?
  • Next by thread: Re: Are these the same and correct?
  • Index(es):
    • Date
    • Thread