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

Re: case-insensitive NSDictionary


  • Subject: Re: case-insensitive NSDictionary
  • From: "Paul Sanders" <email@hidden>
  • Date: Mon, 16 Mar 2009 15:57:17 -0000

>> You could swizzle the objectForKey: and setObject:forKey: methods
>> with your own that just lowercase the passed in string and then call
>> the actual methods with the new key.

> Wile certainly a creative solution, this suggestion is an 11 on the
> scale of 1 to 10 of bad ideas.   Even if it would work, which it won't
> because NSDictionary -- as noted later -- is a class cluster.

> The swizzling would change the behavior of all NSDictionary
> instances.   I'd wager a rather large sum of money that the rest of
> the AppKit, Foundation, CoreFoundation, CoreData, and any other
> framework that uses NSDictionary instances would have at least one
> case where making all strings suddenly case insensitive as keys would
> behave rather badly.

Why not just subclass NSDictionary to do this?  Seems straightforward to me.

What is swizzling?

Rgds - Paul Sanders.

_______________________________________________

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: case-insensitive NSDictionary
      • From: Bill Bumgarner <email@hidden>
References: 
 >case-insensitive NSDictionary (From: Roland King <email@hidden>)
 >Re: case-insensitive NSDictionary (From: Dave DeLong <email@hidden>)
 >Re: case-insensitive NSDictionary (From: Bill Bumgarner <email@hidden>)

  • Prev by Date: Re: Do hard links have creation dates?
  • Next by Date: Re: case-insensitive NSDictionary
  • Previous by thread: Re: case-insensitive NSDictionary
  • Next by thread: Re: case-insensitive NSDictionary
  • Index(es):
    • Date
    • Thread