Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSViewController binding problem



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.