Re: NSViewController Binding Problem continued
Re: NSViewController Binding Problem continued
- Subject: Re: NSViewController Binding Problem continued
- From: Ivy Feraco <email@hidden>
- Date: Fri, 18 Jul 2008 10:41:35 -0400
Hm.
Sean, I don't seem to be getting anything in my debugger or in Console
when I try to establish bindings in IB as I did before.
Just silence.....and not working.
I'm wondering if at the very least the representedObject can be bound
to in IB when it is a model object
(not ObjectController or arrayController).
Ivy Feraco
UI Developer
Message: 6
Date: Thu, 17 Jul 2008 12:26:18 -0400
From: "Sean McBride" <email@hidden>
Subject: Re: NSViewController Binding Problem continued
To: "Ivy Feraco" <email@hidden>, <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=ISO-8859-1
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