• 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: Custom zones...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom zones...


  • Subject: Re: Custom zones...
  • From: Alastair Houghton <email@hidden>
  • Date: Tue, 10 Aug 2010 09:31:26 +0100

On 10 Aug 2010, at 05:18, charlie wrote:

> As you can see, the c string is successfully allocated from space in the custom zone.  But the NSString object is allocated from the default zone, despite having called +[NSObject allocWithZone:].
>
> Anyone know the trick to this?

Sounds like a bug to me.  While zones are *discouraged* (they're very definitely an advanced topic and easily misused), I don't think they're actually deprecated.

Anyway, the solution is to drop down a layer to Core Foundation.  You can make an allocator that will use an NSZone easily enough using CFAllocatorCreate(), then pass that into CFStringCreate() as the allocator argument.

Kind regards,

Alastair.

--
http://alastairs-place.net




_______________________________________________

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

  • Follow-Ups:
    • Re: Custom zones...
      • From: Bill Bumgarner <email@hidden>
References: 
 >Custom zones... (From: "charlie" <email@hidden>)

  • Prev by Date: Re: Proper UTI for accepting files dropped on my table view?
  • Next by Date: Re: calling a function in one class from another
  • Previous by thread: Re: Custom zones...
  • Next by thread: Re: Custom zones...
  • Index(es):
    • Date
    • Thread