Core data and @unionOfSets
Posted
by KevinD
on Stack Overflow
See other posts from Stack Overflow
or by KevinD
Published on 2010-03-25T01:31:12Z
Indexed on
2010/03/25
1:33 UTC
Read the original article
Hit count: 490
Im having trouble using the @unionOfSets on my core-data objects.
NSLog(@"%@", [NSApp valueForKeyPath:@"delegate.mainWindowController.sidebarViewController.arrayController.selection.list.listElement"]);
Prints the set of listElements as expected
2010-03-24 18:11:15.844 Pirouette[7459:80f] Relationship objects for {( (entity: PRPlaylistElement; id: 0x10a71b0 ; data: ), (entity: PRPlaylistElement; id: 0x10ac7d0 ; data: ), (entity: PRPlaylistElement; id: 0x10acf60 ; data: ), (entity: PRPlaylistElement; id: 0x10a6850 ; data: )
However when I try to get the set of file objects for each of the list elements.
NSLog(@"%@", [NSApp valueForKeyPath:@"delegate.mainWindowController.sidebarViewController.arrayController.selection.list.listElement.@unionOfArrays.file"]);
I get the following error
2010-03-24 18:16:45.843 Pirouette[7505:80f] An uncaught exception was raised
2010-03-24 18:16:45.844 Pirouette[7505:80f] [<NSCFSet 0x10415e0> valueForKeyPath:]: this class does not implement the unionOfArrays operation.
2010-03-24 18:16:45.847 Pirouette[7505:80f] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '[<NSCFSet 0x10415e0> valueForKeyPath:]: this class does not implement the unionOfArrays operation.'
Confused because I thought calling to-many relationships in core-data were NSSets.
© Stack Overflow or respective owner