• 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 initWithUTF8String - crazy retainCount with empty string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString initWithUTF8String - crazy retainCount with empty string


  • Subject: Re: NSString initWithUTF8String - crazy retainCount with empty string
  • From: "Simon Strandgaard" <email@hidden>
  • Date: Sat, 24 Mar 2007 17:39:21 +0100

On 3/24/07, Andy Lee <email@hidden> wrote:

On Mar 24, 2007, at 11:33 AM, Simon Strandgaard wrote:

> I have asserts on retainCount a few places in my code,
> and today I got surprised that with NSString sets a weird
> retainCount when initialized with an empty string.
> It looks like a bug to me?

It is not a bug.
[snip code]
This explains the constantly increasing retain count -- it is a
retain count on a behind-the-scenes global object that is never meant
to be deallocated.  (Interestingly, that global object is not the
same as @"".)
[snip]

Thanks for your great efforts. Interesting observation about @"".

--
Simon Strandgaard
http://opcoders.com/
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >NSString initWithUTF8String - crazy retainCount with empty string (From: "Simon Strandgaard" <email@hidden>)
 >Re: NSString initWithUTF8String - crazy retainCount with empty string (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: NSString initWithUTF8String - crazy retainCount with empty string
  • Next by Date: Re: NSString initWithUTF8String - crazy retainCount with empty string
  • Previous by thread: Re: NSString initWithUTF8String - crazy retainCount with empty string
  • Next by thread: Fwd: MVC Design Question
  • Index(es):
    • Date
    • Thread