I am struggling with bindings. I have worked through the examples in the 
Hillegass book, but it seems that none of the examples using NSPopUp quite 
matches what I need.

In my app, just before a view appears, it gets handed a list of games in an 
NSMutableArray. It makes the array available with -(NSMutableArray*)gameList. I 
want the NSPopUp to contain a list showing the value of -(NSString*)description 
for each item in the list.

I thought I was supposed to do this by adding an NSArrayController to my .nib 
file, and then making the following bindings:
    Array Controller's Content Array = File's Owner.gameList
    NSPopUp's Content = Array Controller.arrangedObjects

At runtime I get a totally empty popup. I can imagine two possibilities for why 
it doesn't work:
a) I've got the bindings wrong
b) The array controller can't handle the fact that the gameList pointer changes 
right before the view gets shown

Can anyone help me get this working?

-------------------------------

Just in case it helps pre-answer any questions you may have, here are minimal 
descriptions of my classes:

@interface GameScores {
}
-(NSString*)description;
@end

@interface GameViewController {
  NSMutableArray* gameList;
}
@property (retain) NSMutableArray* gameList;
@end

In the .nib file, NSArrayController tries to manage File's Owner.gameList, and 
the NSPopUp is supposed to display the NSArrayControler's arrangedObjects.


_______________________________________________

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