Binding popup contents difficulties
Binding popup contents difficulties
- Subject: Binding popup contents difficulties
- From: Ken Tozier <email@hidden>
- Date: Mon, 29 May 2006 03:01:16 -0400
Hi
I'm having some problems binding the contents of a popup button.
Here's what I've done so far.
1. Create a properties dictionary in my NSWindowController subclass
with the following structure
{
site = {
{id=1, name='Boston'},
{id=2, name='New York'},
{id=3, name='Chicago'},
{id=4, name='Los Angeles'},
etc...
}
}
2. create an accessor method to get the sites from the property
dictionary
- (NSArray *) site
{
return [properties objectForKey: @"site"];
}
3. In the nib file, set the custom class of the file's owner to
MyWindowController.
4. Create an NSArrayController in the nib and connect its "content"
outlet to the file owner
5. Add a "site" key to the array controller.
6. Tried binding the popup to the array controller in each of the
following ways:
- content
Bind to: PopupArrayController
Controller Key: arranged objects
Model key path: <tried leaving empty and entering "site">
-> Result empty popup
- content + contentObjects
Content:
Bind to: PopupArrayController
Controller Key: arranged objects
Model key path: <tried leaving empty and entering "site">
Content Objects:
Bind to: PopupArrayController
Controller Key: selection
Model key path: <tried leaving empty and entering "site">
-> Result empty popup
- contentValues
Bind to: PopupArrayController
Controller Key: site
Model key path: <tried leaving empty and entering "site">
-> Result empty popup
Anyone point out what I'm doing wrong here?
Thanks for any help
Ken
P.S. does anyone know of a good site that explains binding options in
detail? There's so many options for each binding property, it's
really confusing trying to figure out why they were created in the
first place and what situations call for what options.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden