Re: Bindings: NSMutableArray -> NSArrayController -> NSPopUp
Re: Bindings: NSMutableArray -> NSArrayController -> NSPopUp
- Subject: Re: Bindings: NSMutableArray -> NSArrayController -> NSPopUp
- From: Charles Jenkins <email@hidden>
- Date: Wed, 20 Jan 2010 13:01:47 -0500
Okay, let me rephrase my question...
If I get a pointer to the NSArrayController and then call
[myArrayController setContent:gameList], then should the array
controller "just work"?
In other words, if the game descriptions do not appear in my NSPopUp,
then the problem just about has to be in the binding of the NSPopUp to
the array controller, right?
On 2010-01-17 15:17, Charles Jenkins wrote:
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 (email@hidden)
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:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden