Hi folks,
I've got a single NSPopupButton. The content is bound to an NSArrayController arrangedObjects and value bound an attribute. All good. THe ArrayController is sourcing a Core Data store for its array and this is all good too. The problem is when the window is loaded the NSPopupButton is showing "No Value" which I assume is because it hasn't been told which object in the array it should be showing by default. I have the NSPopupButton SelectedObject bound to an NSManageObject *selectedAccount variable in my custom window controller.

Moving the NSPopup correctly points my selectedObject variable at the object chosen. However, in my attempts to remove the default "No Value" I'm attempting to set the SelectedObject variable to the first object in the array.

selectedObject = [[myArrayController arrangedObjects] objectAtIndex:0];

This doesn't work as the arrangedObject array is empty. NSLog returns a count of zero.

This is the correct way to set the default on an NSPopup isn't it? I set the bound selectedValue, not the control itself. Why is my arrangedObjects array empty on window load?
_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to