On 2010 May 23, at 09:07, Paul Johnson wrote: > I'm looking for an example of the use of a popup menu to determine the array > items to display in a tableview. I'm trying to use Core Data and do this in > Interface Builder as much as possible.
I can't think of any sample code to show exactly this, but it should not be too difficult. As always, bind your table column(s) through an array controller. Bind the 'Content Array' of the array controller to some object which will dynamically provide the array you desire. Pulling an example out one of my document-based Core Data projects, I've bound it to File's Owner which is a window controller. The Model Key Path is document.myDynamicArray, and then in your document object implement myDynamicArray to return an array which would depend on the popup selection. Alternatively, you might be able to do this with less code by setting the representedObject of each menu item in your popup menu to a desired array, and then binding the 'Content Array' of the array controller to this popup button with Model Key Path selectedItem.representedObject, or something like that. _______________________________________________ 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]
