NSTableView with ArrayController bindings not updating?
NSTableView with ArrayController bindings not updating?
- Subject: NSTableView with ArrayController bindings not updating?
- From: Ben Golding <email@hidden>
- Date: Sun, 2 Jan 2011 11:13:47 +1100
I feel like I must be doing something silly but I can't see it.
I am writing a crossword setting application. I have a Crossword class which has two instance variables, grid and clues each of which is a custom class (Grid and Clues).
My problem relates to the Clues class which has two instance variables, across and down, both NSMutableArray's of Clue objects, which I want to display in a table view. I have set up an NSObjectController to interact with the document's Crossword object. I then set up an array controller to manage the (say) across clues. It looks like:
Bind to Crossword Controller
Controller key selection
Model key path clues.across
And when I do this, the table view is empty which completely puzzles me.
When I inspect the array controller using gdb, I can see that it has the right number of Clue instances, they're just not displaying. I don't understand why not.
I've tried putting in an "alias" to the across clues in the NSDocument using:
self.acrossClues = self.crossword.clues.across;
When I redirect the array controller to use that it works, ie, using:
Bind to File's owner
Controller key (none)
Model key path acrossClues
That leaves me believing that the bindings from the NSTableView columns to the array controller are correct.
Can anyone enlighten me why using my first attempt isn't working?
Many thanks,
Ben.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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