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 7727385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:26:45+00:00 2026-06-01T05:26:45+00:00

Based on the data model below And based on user input I create a

  • 0

Based on the data model below

dataModel

And based on user input I create a NSSet of managedObjects of entity Tag called selectedTags.


My problem:

[NSPredicate predicateWithFormat:@"ANY entryTags IN %@", selectedTags];

… this will return any Entry with at least one entryTag that is in the selectedTags set.

I want something along the lines of:

[NSPredicate predicateWithFormat:@"ALL entryTags IN %@", selectedTags];

… notice the only change is the “ANY” to “ALL”. This illustrates what I want, but does not work.

To formulate the outcome I expect:

I’m looking for a solution that will return only Entries who’s entryTags are all in the selectedTags list (but at the same time, if possible, not necessarily the other way around).

To further illustrate:

(tag)Mom
(tag)Dad
(tag)Gifts

(entry)she is a she…..(tag)mom
(entry)he is a he……..(tag)dad
(entry)gifts for mom…(tags:)mom, gifts
(entry)gifts for dad…..(tags:)dad, gifts

If selectedTags contains “mom” and “gifts”, then the entry “gifts for dad” will show up, since it has the tag “gifts”. I’d rather have it not show 🙂

  • 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-01T05:26:46+00:00Added an answer on June 1, 2026 at 5:26 am

    This is the definite answer so far:

    [NSPredicate predicateWithFormat:@"SUBQUERY(entryTags, $tag, $tag IN %@).@count = %d", selectedTags, [selectedTags count]];
    

    B-E-A-U-T-I-F-U-L.

    Thanks to Dave DeLong.

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

Sidebar

Related Questions

I have an Entity Data Model-based app that uses SQL Server CE 3.5 as
I'm building a gui component that has a tree-based data model (e.g. folder structure
After obtaining data from a model form based on a Model, say form_data =
I have an iPhone app which has a Table View-based data input screen with
Given the following Core Data Model: -> : to-one releationship ->>: to-many relationship Entity
I have 3 model, User, Post, Comment with definition like below class Post <
I am trying to update the Django User model with the class based UpdateView
The following code creates a form based on a model, Post . Problem I
I'm building a tree-based data structure and overloaded [ ] so that I can
I am developing a PHP web based data entry tool with MySQL as the

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.