Core Data <--> NSTreeController ==> [MO count]: selector not recognized
Core Data <--> NSTreeController ==> [MO count]: selector not recognized
- Subject: Core Data <--> NSTreeController ==> [MO count]: selector not recognized
- From: "Frederick C. Lee" <email@hidden>
- Date: Fri, 24 Mar 2006 11:58:30 -0800
Simplified Tree:
Region --->> Country --->> Province --->> City (*city bombs*)
Simplified MO graph:
EntityManagedObject : NSManagedObject
RegionMO : EntityManagedObject
CountryMO : EntityManagedObject
ProvinceMO : EntityManagedObject
CityMO : EntityManagedObject
========
I'm using 'child' as the NSTreeController 's Children Key Path.
Inside ManagedObjects' instances:
// Entity: <-- This gets hit first.
- (NSSet *) child {
NSLog(@"{EntityManagedObject.m: NSSet child}");
NSSet * tmpValue;
[self willAccessValueForKey: @"country"];
tmpValue = [self primitiveValueForKey: @"country"];
[self didAccessValueForKey: @"country"];
return tmpValue;
}
// Region:
- (NSSet *) child {
NSLog(@"{RegionManagedObject.m: NSSet child}");
NSSet * tmpValue;
[self willAccessValueForKey: @"country"];
tmpValue = [self primitiveValueForKey: @"country"];
[self didAccessValueForKey: @"country"];
return tmpValue;
}
// Country:
- (NSSet *) child {
NSLog(@"{CountryManagedObject.m: NSSet child}");
NSSet * tmpValue;
[self willAccessValueForKey: @"province"];
tmpValue = [self primitiveValueForKey: @"province"];
[self didAccessValueForKey: @"province"];
return tmpValue;
}
// Province:
- (NSSet *) child {
NSLog(@"{ProvinceManagedObject.m: NSSet child}");
NSSet * tmpValue;
[self willAccessValueForKey: @"country"];
tmpValue = [self primitiveValueForKey: @"country"];
[self didAccessValueForKey: @"country"];
return tmpValue;
}
// City:
- (NSSet *) child {
NSLog(@"{CityManagedObject.m: NSSet child}");
NSSet * tmpValue;
[self willAccessValueForKey: @"city"];
tmpValue = [self primitiveValueForKey: @"city"];
[self didAccessValueForKey: @"city"];
return tmpValue;
}
====================
NSBrowser output:
Europe --> Germany --> Bavaria ---> ! <error>
But when I click on Bavaria cell, I get the following:
{RegionManagedObject.m: NSSet child}
{CountryManagedObject.m: NSSet child}
{ProvinceManagedObject.m: NSSet child}
*** -[CountryManagedObject count]: selector not recognized [self =
0x6a44c0]
*** -[CountryManagedObject count]: selector not recognized [self =
0x6a44c0]
I'm stuck here.
I was able to direct the NSTreeController child link to each
subordinate MO till the Province.
Beyond Province, the abyss.
I did not specify any 'count key path' in the NSTreeController
attribute.
Any solution, ideas?
Ric.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden