• 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: mmalc crawford <email@hidden>
  • Date: Sat, 24 Mar 2007 09:46:36 -0700


On Mar 24, 2007, at 9:31 AM, Simon Strandgaard wrote:

As a relatively unexperienced mac developer, I wrongly assumed that
NSString initWithUTF8String would return an unique instance.
I still don't master referencecounting and thus believed that having
a check to ensure things were good would help me to detect when
I had screwed up refcounting.  Long story.

Understood -- this is a common pattern of misconception.

I was sure that this was covered in the documentation somewhere, but can't find it (modulo the comment in the retainCount method).
There needs to be a section somewhere that makes it clear that approaching memory management like this is almost always going to result in confusion and frustration. Perhaps you could identify where in the documentation you would have been most likely to find this mentioned, and file a bug report (<http://bugreport.apple.com>) to have it included...


mmalc

_______________________________________________

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


  • Follow-Ups:
    • Re: NSString initWithUTF8String - crazy retainCount with empty string
      • From: "Simon Strandgaard" <email@hidden>
    • Re: NSString initWithUTF8String - crazy retainCount with empty string
      • From: Steve Weller <email@hidden>
References: 
 >NSString initWithUTF8String - crazy retainCount with empty string (From: "Simon Strandgaard" <email@hidden>)
 >Re: NSString initWithUTF8String - crazy retainCount with empty string (From: mmalc crawford <email@hidden>)
 >Re: NSString initWithUTF8String - crazy retainCount with empty string (From: "Simon Strandgaard" <email@hidden>)
 >Re: NSString initWithUTF8String - crazy retainCount with empty string (From: mmalc crawford <email@hidden>)
 >Re: NSString initWithUTF8String - crazy retainCount with empty string (From: "Simon Strandgaard" <email@hidden>)

  • Prev by Date: Re: NSString initWithUTF8String - crazy retainCount with empty string
  • Next by Date: Re: Predicate for Array Controller - only parents with children - SOLVED
  • Previous by thread: Re: NSString initWithUTF8String - crazy retainCount with empty string
  • Next by thread: Re: NSString initWithUTF8String - crazy retainCount with empty string
  • Index(es):
    • Date
    • Thread