NSTableView+NSArraController+CoreData
parfeon <[email protected]>
| Newsgroups | gmane.comp.macosx.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello everyone.
I'm looking for some help to figure out something, because I'm already brake
my brain.
We have some NSTableView for example with 1 column (track title)
CoreData model looks similar to this:
[Track Entity] [Playlist Entity]
NSString *title NSString *title
relationship playlists <<==>> relationship tracks
many-to-many
Relationship in both entities is to-many.
Via IB (same if via code) I'm bind my NSArrayController (with prepare
content flag and Entity name: Track) to my delegate class which will return
reference on NSManagedObjectContext (of created in init function context).
NSTableColumn is bind to my NSArrayController object with 'controller key' =
'arrangedObjects', 'model key path' = 'title'
Delegate class have IBOutline NSArrayController aController; (bind via IB to
NSArrayController object)
Build, all works great, table view shows my track titles. But when I try to
set filter predicate for aController, which should show tracks from playlist
with provided playlist name.
So I make this:
[aController setFilterPredicate:[NSPredicate predicateWithFormat:@"ANY
playlists.title like[c] %@", @"playlist #1"]];
I'll get an exception:
[<NSComparisonPredicate 0x5d07800> valueForUndefinedKey:]: this class is not
key value coding-compliant for the key title.
What I'm doing wrong? Maybe there is another way to solve this problem?
Thanks,
Sergey Mamontov
--
View this message in context: http://old.nabble.com/NSTableView%2BNSArraController%2BCoreData-tp26484999p26484999.html
Sent from the OmniGroup - MacOSX-Dev mailing list archive at Nabble.com.