Any good ideas for doing a key-case-insensitive NSDictionary of
NSString to NSString? I have some HTTP headers I want to stick in a
dictionary and look up later. HTTP headers have case-insensitive keys.
I could upper, or lowercase the key before putting it in the
NSMutableDictionary, but that me
You could also just make your own wrapper class for NSDictionary with
the usual set/remove methods and sub the key in the wrapper.
On Mar 16, 2009, at 9:37 AM, Bill Bumgarner wrote:
Wile certainly a creative solution, this suggestion is an 11 on the
scale of 1 to 10 of bad ideas. Even if
dictionary must
be NSMutableArrays of strings.
On 16 Mar 2009, at 14:02, Roland King wrote:
Any good ideas for doing a key-case-insensitive NSDictionary of
NSString to NSString? I have some HTTP headers I want to stick in a
dictionary and look up later. HTTP headers have case-insensitive keys.
I could
On Mon, Mar 16, 2009 at 2:20 PM, Stuart Malin wrote:
>
> On Mar 16, 2009, at 7:55 AM, Sherm Pendley > wrote:
>
> Beats me - I've often wondered the same thing. All you need to do is
> implement the required primitive methods. What's so hard about that?
>
>
> Question from a non-expert:
>
> How d
On Mon, Mar 16, 2009 at 2:20 PM, Stuart Malin wrote:
>
> On Mar 16, 2009, at 7:55 AM, Sherm Pendley wrote:
>
> On Mon, Mar 16, 2009 at 12:03 PM, Michael Ash wrote:
>
>
> Why does everybody think that subclassing a class cluster is hard?
>
>
> Beats me - I've often wondered the same thing. All yo
On Mar 16, 2009, at 11:20 AM, Stuart Malin wrote:
How does one know just which methods are "required primitive"
methods for some class? Is that discernible from documentation?
Header file?
They are documented, but the header files also split the primitives
from the rest.
Look at NSString
On Mar 16, 2009, at 7:55 AM, Sherm Pendley
wrote:
On Mon, Mar 16, 2009 at 12:03 PM, Michael Ash
wrote:
Why does everybody think that subclassing a class cluster is hard?
Beats me - I've often wondered the same thing. All you need to do is
implement the required primitive methods. W
On Mon, Mar 16, 2009 at 12:03 PM, Michael Ash wrote:
>
> Why does everybody think that subclassing a class cluster is hard?
Beats me - I've often wondered the same thing. All you need to do is
implement the required primitive methods. What's so hard about that?
sherm--
--
Cocoa programming i
On Mar 16, 2009, at 8:57 AM, Paul Sanders wrote:
Why not just subclass NSDictionary to do this? Seems
straightforward to me.
That would certainly be viable. I made a different assumption than
you; namely that the strings should continue to hash and isEqual: as
case insensitive outside o
> Why not just subclass NSDictionary to do this? Seems straightforward to
> me.
> What is swizzling?
Ah, OK, having just read Michael's post I now understand what the problem
is. Sorry about that, the solution proposed is otherwise admirably simple.
Rgds - Paul Sanders.
On Mon, Mar 16, 2009 at 11:52 AM, Jean-Daniel Dupas
wrote:
>
> Le 16 mars 09 à 16:37, Bill Bumgarner a écrit :
>
>> On Mar 16, 2009, at 7:05 AM, Dave DeLong wrote:
>>>
>>> You could swizzle the objectForKey: and setObject:forKey: methods with
>>> your own that just lowercase the passed in string a
>> 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 w
Le 16 mars 09 à 16:37, Bill Bumgarner a écrit :
On Mar 16, 2009, at 7:05 AM, Dave DeLong wrote:
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 crea
On Mon, Mar 16, 2009 at 11:07 AM, Dave DeLong 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 wou
On Mar 16, 2009, at 7:05 AM, Dave DeLong wrote:
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
sc
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. =)
Dave
On Mar 16, 2009, at 8:
On Mar 16, 2009, at 7:37 AM, Michael Ash wrote:
On Mon, Mar 16, 2009 at 10:26 AM, Adam R. Maxwell
wrote:
On Mar 16, 2009, at 7:02 AM, Roland King wrote:
Any good ideas for doing a key-case-insensitive NSDictionary of
NSString
to NSString? I have some HTTP headers I want to stick in a
On Mon, Mar 16, 2009 at 10:26 AM, Adam R. Maxwell wrote:
>
> On Mar 16, 2009, at 7:02 AM, Roland King wrote:
>
>> Any good ideas for doing a key-case-insensitive NSDictionary of NSString
>> to NSString? I have some HTTP headers I want to stick in a dictionary and
>>
ideas for doing a key-case-insensitive NSDictionary of
NSString to NSString? I have some HTTP headers I want to stick in a
dictionary and look up later. HTTP headers have case-insensitive
keys.
Use a CFDictionary with custom key callbacks that have a case-
insensitive hash and equality function
On Mar 16, 2009, at 7:02 AM, Roland King wrote:
Any good ideas for doing a key-case-insensitive NSDictionary of
NSString to NSString? I have some HTTP headers I want to stick in a
dictionary and look up later. HTTP headers have case-insensitive keys.
Use a CFDictionary with custom key
-insensitive NSDictionary of
NSString to NSString? I have some HTTP headers I want to stick in a
dictionary and look up later. HTTP headers have case-insensitive keys.
I could upper, or lowercase the key before putting it in the
NSMutableDictionary, but that means I lose the original case of the
key
Any good ideas for doing a key-case-insensitive NSDictionary of
NSString to NSString? I have some HTTP headers I want to stick in a
dictionary and look up later. HTTP headers have case-insensitive keys.
I could upper, or lowercase the key before putting it in the
NSMutableDictionary, but
22 matches
Mail list logo