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 (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to