• 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: NSString Retain Count of 2147483647
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString Retain Count of 2147483647


  • Subject: Re: NSString Retain Count of 2147483647
  • From: "Sean McBride" <email@hidden>
  • Date: Wed, 24 Jun 2009 12:29:02 -0400
  • Organization: Rogue Research Inc.

On 6/24/09 10:26 AM, Thomas Wetmore said:

>When I use NSScanners to chop strings up, whenever I pull a one-
>character string out of a scanner that string has a retain count of
>2147483647 (2**32 - 1). My guess is that there are pre-allocated, one-
>character strings for all (most?) characters that are given this
>maximum possible value of a retain count, the digital equivalent of
>infinity.

Returning a large retain count like that is indeed Apple's singleton pattern:

<http://developer.apple.com/documentation/Cocoa/Conceptual/
CocoaFundamentals/CocoaObjects/CocoaObjects.html#//apple_ref/doc/uid/
TP40002974-CH4-SW32>

As others have said, don't rely on retainCount for much of anything. :)

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >NSString Retain Count of 2147483647 (From: Thomas Wetmore <email@hidden>)

  • Prev by Date: GC pros and cons
  • Next by Date: Re: Updating a Build Number
  • Previous by thread: GC pros and cons
  • Next by thread: Re: GC pros and cons
  • Index(es):
    • Date
    • Thread