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

  • Home
  • SEARCH
  • 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 8719557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:49:42+00:00 2026-06-13T06:49:42+00:00

I have a fetch request as follows: NSFetchRequest *songRequest = [NSFetchRequest fetchRequestWithEntityName:@Song]; I also

  • 0

I have a fetch request as follows:

NSFetchRequest *songRequest = [NSFetchRequest fetchRequestWithEntityName:@"Song"];

I also have an NSSet of Genre (NSManagedObjects) called genreFilter.

I want to set up a predicate to filter songs that have relationships to the genres in genreFilter.

Could I set up an NSPredicate in this manner:

NSPredicate *songRequestPredicate = [NSPredicate predicateWithFormat:@"genre IN %@", [_genreFilter allObjects]];

?

Genres look like this:

@interface Genre : NSManagedObject

@property (nonatomic, strong) NSNumber * id;
@property (nonatomic, strong) NSString * name;
@property (nonatomic, strong) NSSet *preset;
@property (nonatomic, strong) NSSet *song;
@end
@interface Genre (CoreDataGeneratedAccessors)

- (void)addPresetObject:(Preset *)value;
- (void)removePresetObject:(Preset *)value;
- (void)addPreset:(NSSet *)values;
- (void)removePreset:(NSSet *)values;

- (void)addSongObject:(Song *)value;
- (void)removeSongObject:(Song *)value;
- (void)addSong:(NSSet *)values;
- (void)removeSong:(NSSet *)values;

@end

and songs like this:

@interface Song : NSManagedObject

@property (nonatomic, strong) NSNumber * arousal;
@property (nonatomic, strong) NSNumber * id;
@property (nonatomic, strong) NSNumber * match;
@property (nonatomic, strong) NSNumber * popularity;
@property (nonatomic, strong) NSNumber * valence;
@property (nonatomic, strong) NSNumber * cloud;
@property (nonatomic, strong) Genre *genre;
@property (nonatomic, strong) Year *year;
@property (nonatomic, strong) Period *period;
@property (nonatomic, strong) NSNumber *yearReleased;

@property (nonatomic, assign) float score;
@property (nonatomic, readonly) MPMediaItem *mediaItem;

@end
  • 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-06-13T06:49:43+00:00Added an answer on June 13, 2026 at 6:49 am

    Yes. That looks correct to me.

    Here is an answer I gave to another question, it contains simple instructions and code to get a barebones core-data project up and running. I often use this basic setup to quickly test things like this.

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

Sidebar

Related Questions

I have following xml and I want to fetch the value of node which
Using Core Data, I have a fetch request to fetch the minimum of a
I have a ViewController whose view results from data from a fetch request with
I want to make a CoreData fetch request on a background thread in order
I have an array of dictionaries which results from an Core Data fetch request
I have a basic question. Say you have a NSFetchRequest which you want to
I have a fetch request which response looks like this. response = { id:
So I have this javascript function, it sends an ajax requests to fetch a
I have to fetch all the files from a folder and i am using
I have to fetch sales representative's name and customer support's email id. So in

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.