• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CoreData "in" predicate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CoreData "in" predicate


  • Subject: CoreData "in" predicate
  • From: Rick Mann <email@hidden>
  • Date: Sun, 2 May 2010 05:27:15 -0700

Hi.

I have two entities: Mission and Favorite. Favorite has a single relation to Mission. I need to fetch all Mission objects that exist in Favorite. I'm using an NSFetchResultsController.

I created an array with all the Mission objects found in the Favorite entity. Then I tried to create a predicate like this:

	NSPredicate* pred = [NSPredicate predicateWithFormat: @"in %@", favoriteMissions];

and use that on a fetch of Mission objects. But it complains that it can't parse that format string.

Clearly, this approach isn't going to work. I could store the Mission's key in the Favorite table instead, but that's less elegant. Might be the only way to go.

Any suggestions?

tia,
Rick

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: CoreData "in" predicate
      • From: Frederick Reimer <email@hidden>
  • Prev by Date: Re: Value Bindings in IB - Where's the documentation?
  • Next by Date: Re: CoreData "in" predicate
  • Previous by thread: Re: Value Bindings in IB - Where's the documentation?
  • Next by thread: Re: CoreData "in" predicate
  • Index(es):
    • Date
    • Thread