Re: NSDictionary allocation
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