Re: NSViewController Binding Problem continued
Re: NSViewController Binding Problem continued
- Subject: Re: NSViewController Binding Problem continued
- From: "Sean McBride" <email@hidden>
- Date: Thu, 17 Jul 2008 12:26:18 -0400
- Organization: Rogue Research
On 7/17/08 11:53 AM, Ivy Feraco said:
>There was a previous post back in April about a problem with binding
>to the representedObject in NSViewController.
I missed that, but I am having problems binding via NSViewController's
representedObject too.
>When instantiating the view controller, I set the represented object
>to an NSArrayController.
I'm using NSObjectController.
>vc = [[MyViewController alloc] initWithNibName:@"newView" bundle:nil];
>[vc setRepresentedObject:arrayController];
>
>When setting the bindings in the nib file, I make the File's Owner
>MyViewController class, then try to bind columns of NSTableView to the
>File's Owner using a path like
>representedObject.arrangedObjects.displayText.
>
>This would not work, even though the array controller does contain data.
Did not work how? In my case, when I attempt to bind a view's binding,
IB fails to connect the binding and prints the following in Console:
2008-07-17 12:13:54 Interface Builder[9568] Ignoring exception related
to working with bindings: NSUnknownKeyException, [<NSCustomObject
0x1b8c0520> addObserver:<MyCustomView 0x1b8c7490>
forKeyPath:@"representedObject.selection.subjectToBrainsightTransform"
options:0x0 context:0x7d3] was sent to an object that is not KVC-
compliant for the "representedObject" property.
Do you see something similar in Console?
Now in my case, the view in question is my own custom NSView subclass,
it exposes about a dozen bindings and they've been working for a very
long time. I've only seen problems once I started using NSViewContoller.
By connecting gdb to IB:
(gdb) po 0x1b8c0520
<NSCustomObject(MyViewController) 0x1b8c0520>
Looks like some kind of IB object meant to stand in for my viewcontroller.
>A previous post brought up the exact same issue, and he worked around
>it by using the awakefromNib method to bind the table to the
>representedObject's arrangedObjects in code. I did something similar
>using the windowDidLoad method.
I'll have to try that...
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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