• 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: How to lock an object?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to lock an object?


  • Subject: Re: How to lock an object?
  • From: Scott Ribe <email@hidden>
  • Date: Fri, 05 Jun 2009 12:26:55 -0600
  • Thread-topic: How to lock an object?

> For example, NSString often uses
> another allocation internally to hold the string data, and you have no
> way to know where that is.

Even if you use initWithBytesNoCopy:, you have no way to know whether some
part of the system will need a string in a different encoding and make a
copy. (Or make a copy in order perform some other manipulation.) You could
take a guess, and try feeding it a UTF-16 buffer. But if even if today's OS
doesn't copy the contents somewhere along the line, that's no guarantee
about next week's update. Once you make an NSString from your data and send
it off to be displayed to the user, you've lost control over whether or not
that data gets copied.

--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice


_______________________________________________

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: 
 >Re: How to lock an object? (From: Greg Parker <email@hidden>)

  • Prev by Date: Re: (newbie) help with combining navigation controller and tab bar controller
  • Next by Date: Re: get a window in front by clicking on a menu item
  • Previous by thread: Re: How to lock an object?
  • Next by thread: Re: Cocoa-dev Digest, Vol 6, Issue 831
  • Index(es):
    • Date
    • Thread