Re: case-insensitive NSDictionary
Re: case-insensitive NSDictionary
- Subject: Re: case-insensitive NSDictionary
- From: Michael Ash <email@hidden>
- Date: Mon, 16 Mar 2009 11:44:47 -0400
On Mon, Mar 16, 2009 at 11:07 AM, Dave DeLong <email@hidden> wrote:
> As a followup, I tried doing this just now, and then realized that I'd
> forgotten that NSDictionary is a class cluster, and so it would probably
> take a lot of gentle massaging to get this method to work correctly.
>
> Using the callback would probably be easier. =)
NSMutableDictionary only has five primitive methods, including the
three in NSDictionary. All you have to do is have an
NSMutableDictionary ivar and pass those five methods along to it,
along with whatever massaging you might want to do. Subclassing a
class cluster when you want to retain most of the original behavior is
*easy*. However, you still have the problem of information loss due to
storing the lowercased strings in the dictionary.
Mike
_______________________________________________
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