> So if the master dictionary and the array for the NSTable are > encapsulated together in a class, you could use NSMutableArray as the > primary structure, and encapsulate a hidden NSMutableDictionary used > only for faster searching. Both are maintained in parallel by the > enclosing class, so there's never any need to ask the dictionary for > its array of values, nor to copy an immutable array to make a mutable > version for table insertion. In short, make a class that > encapsulates all the desired behavior by itself, rather than using a > naked dictionary and the supplementary arrays it makes.
How would I go about doing this and still bind to my NSArrayController? I'd have a (singleton) class MyDataClass with two instance vars: myArray and myDictionary both of which would hold the same objects and both would be mutable. So when I bind the NSArrayController to myArray, and the user adds an item via the table (and thusly the add: of NSArrayController), how will my class know that it needs to also add it to the myDictionary? Thanks, T. _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
