• 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
allocWithZone not working with Class Clusters?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

allocWithZone not working with Class Clusters?


  • Subject: allocWithZone not working with Class Clusters?
  • From: Timothy Ritchey <email@hidden>
  • Date: Thu, 21 Nov 2002 14:54:43 -0500

I've been investigating the whole allocWithZone: issue now that NSCreateZone is working on Jag, and have run across an interesting issue. It seems as if the allocWithZone: method works for basic classes, but not with class clusters, such as NSArray, NSString, etc. I haven't fully explored this yet, but just tried it with a few classes. Things like:


NSZone *z = NSCreateZone( ... );
NSString *s = [[NSString allocWithZone:z] initWithString:...];

if(NSZoneFromPointer(s) == z)
NSLog(@"good");
else if(NSZoneFromPointer(s) == NSDefaultMallocZone)
NSLog(@"bad");

Always return "bad" for NSArrays or NSStrings (mutable or not), but work for things like NSData and NSHost. Is this by design, or are the class cluster implementations not obeying the zone designation, or is it not a class cluster issue at all?

Cheers,
tim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: allocWithZone not working with Class Clusters?
      • From: Nat! <email@hidden>
  • Prev by Date: Animated GIFs anyone?
  • Next by Date: RE: setAccessoryView not responding
  • Previous by thread: Re: Animated GIFs anyone?
  • Next by thread: Re: allocWithZone not working with Class Clusters?
  • Index(es):
    • Date
    • Thread