• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa Bindings and popups
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa Bindings and popups


  • Subject: Re: Cocoa Bindings and popups
  • From: Chuck Musser <email@hidden>
  • Date: Mon, 19 Jul 2004 23:04:37 -0700

typically this can be worked around using the file's owner. It's a proxy for the object that is the owner of the nib. If you're dealing with a document application the DOcument.nib file's owner is the Document subclass.

in the case of a simple single nib application, who is the object that is holding the RidesList array? can you get to it via filesOwner.delegate.ridesList perhaps?

This is a simple single Nib. I have an object defined in the Nib called PostController that holds the rideDescriptionList, which is an NSMutableArray. I'm not sure how to get to it via the File's Owner, but I tried this:

1.) Set File's Owner's delegate outlet to point to my PostController instance.

2.) Set the NSArrayController up like so:

In Bindings, Bind To was set to "File's Owner", Controller Key was left blank (the popup was disabled there) and Model Key Path: delegate.rideDescriptionList

In Attributes, set Object Class Name to "RideDescription"--this is the type of object that rideDescriptionList holds

3.) Set the popup menu like so:

In Bindings,

content settings are:
Bind to: NSArrayController,
Controller Key: arrangedObjects
Model Key Path: <blank>

contentValues are:
Bind to as NSArrayController
Controller Key: arrangedObjects
Model Key Path: label

Note: "label" is one of the instance variables of a RideDescription object--it's an NSString.

This didn't work.

I'm not sure what my RideDescription object needs to do to be KVC-compliant "enough" for this. It does implement a get method for the "label" instance variable:

- (NSString *) label;

Chuck
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: Cocoa Bindings and popups (From: Steve Harris <email@hidden>)
 >Re: Cocoa Bindings and popups (From: Scott Anguish <email@hidden>)
 >Re: Cocoa Bindings and popups (From: Chuck Musser <email@hidden>)
 >Re: Cocoa Bindings and popups (From: Scott Anguish <email@hidden>)

  • Prev by Date: Re: I've lost my MainMenu.
  • Next by Date: Re: NSTextField changing first responder on return key not working
  • Previous by thread: Re: Cocoa Bindings and popups
  • Next by thread: Build Failure
  • Index(es):
    • Date
    • Thread