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

Re: NSDictionary allocation


  • Subject: Re: NSDictionary allocation
  • From: Boyd Collier <email@hidden>
  • Date: Mon, 14 May 2007 19:10:47 -0700

Thanks, Nick and Jean-Olivier, for your very prompt responses. I had bad feelings about what I did, which you confirmed, so I'll take another approach.

Boyd



On May 14, 2007, at 6:18 PM, Nick Zitzmann wrote:


On May 14, 2007, at 5:44 PM, Boyd Collier wrote:

I want to allocate an NSDictionary and initialize its contents with arguments passed to it, and to do this within the initialization I make use of an NSMutableDictionary. But I want the dictionary that's returned from my initialization to be an NSDictionary rather than the NSMutableDictionary.

What you're trying to do will not work. With only a handful of exceptions (see NSObject, NSProxy, NSFormatter, and a couple of others), none of the Foundation classes are made to be subclassable. The reason is because classes like NSArray, NSDictionary, NSSet, NSNumber, NSURL, etc. are actually class clusters instead of concrete classes.


Nick Zitzmann
<http://www.chronosnet.com/>






_______________________________________________

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


References: 
 >NSDictionary allocation (From: Boyd Collier <email@hidden>)
 >Re: NSDictionary allocation (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: Unique items in Core Data models
  • Next by Date: Re: NSDictionary allocation
  • Previous by thread: Re: NSDictionary allocation
  • Next by thread: Re: NSDictionary allocation
  • Index(es):
    • Date
    • Thread