Re: NSArrayController/Modal dialog/KVO Gordian knot
Re: NSArrayController/Modal dialog/KVO Gordian knot
- Subject: Re: NSArrayController/Modal dialog/KVO Gordian knot
- From: vincent habchi <email@hidden>
- Date: Sun, 13 Jun 2010 10:57:26 +0200
Hallo Reinhard,
Le 13 juin 2010 à 09:36, Reinhard Segeler a écrit :
> I am not familiar with the NSDictionaryController but the keypath looks a bit strange:
>
> if theDictionary is what the name says, then a member selection calls a member value calls a member color. That's not the case, isn't it?
theDictionary has a selection made of key/value couples ; each couple is a KVO-compliant object for the keys "key" and "value" and the value is a class object which features a + (NSString *)color method. Believe me, it works all right.
> In my code I bind a popupMenu by using the following path: self.dict.index to select a menu item by index. - no Controller is used here.
>
> I looked in my literature where I found the following:
>
> Bind to: aDictController
> Controller key: selection
> Model key path: name -> in your case color?
In your case, you forget a step (choose between "key" and "value" attributes).
Actually, I found a solution to my problem. Instead of observing the "contents" property of the array to catch changes in the dictionary, I observe "selection" and that works. It does not explain why the "contents" observation does not trigger messaging while the dialog is active, albeit I insert an object in the array.
Tchüß,
Vincent_______________________________________________
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