Re: NSPredicate / NSArray addObserver:forKeyPath:options:context: exception
Re: NSPredicate / NSArray addObserver:forKeyPath:options:context: exception
- Subject: Re: NSPredicate / NSArray addObserver:forKeyPath:options:context: exception
- From: Mikkel Eide Eriksen <email@hidden>
- Date: Sat, 29 Sep 2012 03:17:21 +0200
On 28/09/2012, at 03.51, Keary Suska <email@hidden> wrote:
> On Sep 27, 2012, at 11:54 AM, Mikkel Eide Eriksen wrote:
>>
>> When I run my app, I get an exception (quoted below) as soon as I expose my objects to my array controller (via a property on my document it's bound to), though as far as I can tell, the predicate should be functionally the exact same? For completness, inspecting it in the debugger yields:
>
> I suspect that somewhere in your xib you are binding through the array, which you can't do. Look for a binding key path that begins with or contains "personalNames" and that has a key after it (such as "personalNames.value").
>
The keypath:
ANY personalNames.value.gedcomString CONTAINS "..."
is composed of the following keys:
GCIndividualEntity has a KVC-compliant collection property called _personalNames_ which is an array of GCPersonalNameAttributes which each have a GCValue property called _value_ which again have an NSString property _gedcomString_ (by the way these are NSObjects, not Core Data).
I am not binding to the keypath in my xib, but obtain the predicate via code. The array controller is bound to a property "individuals" on File's Owner (my NSDocument subclass).
When I've loaded the file, I set self.individuals = self.context.individuals, causing a table view bound to the array controller to show the objects; this works as expected, as well as a detail-view connected to the controller's selection. I then attempt to set the array controller's predicate and immediately it dies with the mentioned exception.
Mikkel
_______________________________________________
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