Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5937397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:32:09+00:00 2026-05-22T15:32:09+00:00

I currently have Core Data successfully returning all of the results for a specific

  • 0

I currently have Core Data successfully returning all of the results for a specific entity titled Event:

NSManagedObjectContext *context = [delegate managedObjectContext];
NSEntityDescription *entityDescription = [NSEntityDescription entityForName:@"Event" 
                                                     inManagedObjectContext:context];
NSFetchRequest *request = [[NSFetchRequest alloc] init];
[request setEntity:entityDescription];

NSError *error;
NSArray *fetchResults = [context executeFetchRequest:request error:&error];

One property of the Event entity is a string titled tid. I also have an array filterArray that contains all allowed tid values.

How can I get my Core Data request to only return events that have a tid property that matches one of the values in filterArray? I believe the answer relates to NSPredicate but I am not familiar enough with it yet to get it to bend to my will.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:32:10+00:00Added an answer on May 22, 2026 at 3:32 pm

    Try this:

    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"tid IN %@", filterArray];
    
    [request setPredicate:predicate];
    

    Have a look at the Aggregate Operations in the Predicate Programming Guide.

    EDIT

    Have a look at NSPredicate iPhone 3.2 SDK Core Data “IN clause” NSInvalidArgumentException exception. It’s same error you have. The problem was a typo in the column/attribute name. The syntax should be alright, it can’t just find tid.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have the following in one solution: Core Project (data access, biz logic,
I'm currently facing in problem using Core Data. I have two entities A and
I have an Event database loaded into Core Data that has duplicate Event titles.
I have an application which is currently using and storing data in Core Data.
I currently have a SQLite backed Core Data app where I am fetching records
In my app, I have a UITableView that is populated by Core Data, currently
I have core data configuration in my iPhone app, and how I'm currently passing
Hi I currently have a table view which is being filled via Core Data.
Is it possible to sort results from Core Data based on the entity type,
Possible Duplicate: Core Data not saving NSString. Hey all! Currently experiencing a weird issue

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.