Re: Help debugging bindings issues
Re: Help debugging bindings issues
- Subject: Re: Help debugging bindings issues
- From: Alex Smith <email@hidden>
- Date: Mon, 11 May 2009 18:12:49 -0600
Thank you so much for your help. I took a closer look at my
ArrayController and found that I had bound the
ArrayController.ContentObject to the NSMutableArray that was supposed
to be bound to the ArrayControler.ContentArray. So I guess it was
using something provided by a base class to provide the ContentArray
and thus my exception. It is great to have this finally figured out!
Thanks,
Alex
On May 11, 2009, at 10:47 AM, Quincey Morris wrote:
On May 11, 2009, at 07:43, Alex Smith wrote:
Here is the full error listing.
2009-05-11 08:22:55.043 RaiseMan[2935:10b] [<NSCFArray 0x158f90>
addObserver:forKeyPath:options:context:] is not supported. Key
path: personName
2009-05-11 08:22:55.062 RaiseMan[2935:10b] [<NSCFArray 0x16efb0>
addObserver:forKeyPath:options:context:] is not supported. Key
path: personName
2009-05-11 08:22:55.067 RaiseMan[2935:10b] [<NSCFArray 0x158f90>
addObserver:forKeyPath:options:context:] is not supported. Key
path: expectedRaise
2009-05-11 08:23:02.160 RaiseMan[2935:10b] [<NSCFArray 0x16efb0>
addObserver:forKeyPath:options:context:] is not supported. Key
path: expectedRaise
I am not using an IBOutlet or IBAction for two reasons. 1) The
author did not use them is his example (nor are they in his project
code) and 2) I am binding personName and expectedRaise to the table
columns.
Actually, the terminology works the other way round. You're binding
the table columns to [something that gives you access to properties]
personName and expectedRaise.
So Table Column binding is set to bind to Array Controler,
Controller Key = Arranged Objects, model key path = personName.
(same for expectedRaise).
That's perfectly fine. Note that the table column is actually bound
to ArrayController.arrangedObjects -- that is to an array property
of the ArrayController. For a specific row, the table view fetches
the corresponding [non-array] object of that array, and extracts the
desired properties (personName and expectedRaise) from that [non-
array] object. Although we typically say that the column is "bound
to ArrayController.arrangedObjects.personName", that isn't literally
true because that's not a valid key path. (And that's why controller
key and model key are separate in the binding.)
This suggests that your problem is not the table column binding, but
the ArrayController's content binding (or its content connection, if
you're not using bindings there). According to the error message,
the ArrayController's content is an array of arrays instead of an
array of Person objects.
_______________________________________________
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:
@securesmith.net
This email sent to email@hidden
_______________________________________________
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