Re: multiple keys for object?
Re: multiple keys for object?
- Subject: Re: multiple keys for object?
- From: Justin Spahr-Summers <email@hidden>
- Date: Fri, 1 Apr 2005 18:43:14 -0600
You don't need multiple dictionaries for that. A dictionary cannot
have two identical keys, but it can have two (or more) identical
objects.
On Apr 1, 2005 12:26 PM, Daniel Child <email@hidden> wrote:
> Hi All,
>
> I have a situation where for the most part it makes sense to set up a
> dictonary of objects. The problem is that I want to have more than one
> way (key) to access each object, or in db terms, more than one search
> field for each record. Is it advisable to set up multiple dictionaries
> with their separate keys, but all pointing to one and the same object
> (per record)? as in...
>
> myObject_1= <whatever>;
> [dictionary1 addObject: myObject forKey: key1_2];
> [dictionary2 addObject: myObject forKey: key1_2];
> [dictionary3 addObject: myObject forKey: key1_3];
> myObject_2= <whatever>;
> etc.
>
> Or is this going to cause serious problems. Is there a better way?
> Thanks in advance.
>
> Daniel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden