0

I need to connect 2 entites. The first one - Player (attr = "name"), the second - Profiles (attr: "player_id", "command_id" and other stuff). There is a relationship "player" between Profiles and Player. I want to show the Profile entity but with players names instead of player_ids. player_id is [[[_player objectID] URIRepresentation] absoluteString]. How should I call [fetchRequest setPredicate:[NSPredicate predicateWithFormat:@"player_id==player.<object id>"]]?

2 Answers 2

1

My initital approach was wrong. NSManagedObject subclassed objects should be used instead of their ids.

0

I think what you might be after is Apple's predicate variable substitution.

https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/Articles/cdImporting.html

Scroll down to "Cocoa Fundamental" and check the code to see how Apple does it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.