On Jul 17, 2008, at 10:26 PM, Hamish Allan wrote:

You might wish to file an enhancement request for NSViewController to
provide an init method taking a representedObject to be set up before
attempting bindings etc., which would circumvent this issue.


I wonder if it would actually make a difference in this case. Since the nib doesn't get loaded until the 'load view' method is called and she's setting the rO directly after the initializer (before requesting the view), the result would be the same, right? Either way, the object you're binding to is the view controller and not the array controller that the NSTableView requires.

Or you could argue that, according to the principles of duck typing,
NSTableView shouldn't care, just as long as
representedObject.arrangedObjects.displayText quacks like an array. In
which case it's a bug.


Seems like this is the real issue ;)

I'm really curious to find a solution to this, too - one that doesn't involve adding another array controller to the app or moving the bindings setup to code. Going to code isn't too bad, tho...

I guess that it would be nice if IB would let you bind directly to representedObject when the File's Owner's class is set to an NSViewController so that when the nib is loaded, the table view gets what it wants.

Just some wishful thinking.

Best,
Cathy


_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to