NSViewController binding problem
NSViewController binding problem
- Subject: NSViewController binding problem
- From: Dan Messing <email@hidden>
- Date: Wed, 30 Apr 2008 18:27:42 -0500
Hi, I'm working on refactoring some views into their own nib files,
and am taking a stab at using NSViewControllers. When I instantiate
the view controller I set its representedObject to an
NSArrayController. Something like this:
viewController = [[SSCustomViewController alloc]
initWithNibName:@"newView" bundle:nil];
[viewController setRepresentedObject:arrayController];
In the new nib file, I set the File's Owner to the
SSCustomViewController class, then bind values of columns in an
NSTableView to File's Owner using key paths like
"representedObject.arrangedObjects.displayText".
For some reason this seems to be failing - nothing shows up in my
table view, although I can confirm that the array controller contains
data.
However, when I instead set up the bindings in the custom view
controller's awakeFromNib method, everything seems to work:
[[myTable tableColumnWithIdentifier:@"displayText"] bind:@"value"
toObject:[self representedObject] withKeyPath:@"arrangedObjects.
displayText" options:nil];
Can anybody offer any clues as to what might be going on here, and why
setting up bindings in IB isn't working?
- Dan
_______________________________________________
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