• 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: Dissappearing string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dissappearing string


  • Subject: Re: Dissappearing string
  • From: Uli Kusterer <email@hidden>
  • Date: Wed, 16 May 2012 15:05:11 +0200

On 16.05.2012, at 15:02, Uli Kusterer wrote:
> - copy the string (which means the retain count stays 1, and the string gets deallocated when you release it)

 Forgot to mention: When you *really* have an NSAttributedString (an immutable object), -copy can even be optimized out and be the same as a retain. OTOH if the string given is an NSMutableAttributedString, -copy actually creates an NSAttributedString from that (you'd have to call -mutableCopy to get an NSMutableAttributedString out instead). So there are a lot of factors, including who created the string and how, that influence the retain count going through the very same code.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: 
 >Dissappearing string (From: Charlie Dickman <email@hidden>)
 >Re: Dissappearing string (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Re: Dissappearing string
  • Next by Date: Re: Thread Deadlock
  • Previous by thread: Re: Dissappearing string
  • Next by thread: Layout constraint related exceptions
  • Index(es):
    • Date
    • Thread