CoreData and binding a TableColumn to values from another Entity

Joined
Feb 5, 2014
Messages
1
Reaction score
0
Points
1
Hello mac-forums Community!

I have created 3 entities:
A <-->> B <<--> C, C has a BOOLEAN atribute.

Now I want do display, in a two Column Table, the name of A (1st column) and a boolean value (2nd column) which based on the boolean values from C.

For example:

An Object from type A (called a) owns 3 Objects from Type B (called b1, b2, b3).
Each of these 3 Objects owns 1 Object from Type C (called c1, c2, c3).
If the boolean Attribute of one of these Objects (c1, c2, c3) is TRUE, the boolean in the 2nd column have to be true.

I have tried something like that (with a custom ArrayController Class):

Code:
[NSTableColumn bind:@"value" toObject:self withKeyPath:@"[email protected]" options:nil];
The ArrayController self is in Entity Name mode with Entity Name: A.

but an error occurred:
Code:
[__NSSetI decimalValue]: unrecognized selector sent to instance

without the @sum collector, the Content is like that:
Code:
NSLog(@"%@", [self valueForKeyPath:@"arrangedObjects.b.c.bool"]);

Output:
2014-02-05 15:57:46.747 Cocktail DB[10943:303]
(
    "{(\n)}",
    "{(\n    0,\n    1\n)}",
    "{(\n    1\n)}"
)
in this Example:

a1 owns no objects from type b

a2
-b1 - c3 (boolvalue: 1)
-b2 - c2 (boolvalue: 0)
-b3 - c1 (boolvalue: 1)​
a3
-b4 - c1 (boolvalue: 1)​

:Confused:
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top