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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:39:52+00:00 2026-05-29T05:39:52+00:00

Now, I need to use a predicate for a NSFetchRequest. But things here are

  • 0

Now, I need to use a predicate for a NSFetchRequest.

But things here are a little different, since there are two nested to-many relationships for the predicate to go through.

For instance, my entities are like this:

enter image description here

Now I need to fetch some Month and Week ManagedObjects, but the requirement is that the amount of Events of a Day of the needed Weeks or Months is more than one.

In another word, with reference to a given Week or Month, if any Day on the destination of its “days” relationship has at least one Event, then take it.

So that is a nested to-many relationship, and I don’t know how to set the predicate string.

There are two troubles:

  1. I know ALL and ANY keyword. But could @"ANY days.ANY events" be the keypath? Or how is it supposed to be?

  2. How to judge that the events relationship points to at least one Event object.

Would [@"%K != nil",theCorrectKeypath] work? I’m afraid of that “!= nil” does not equal to at least one destination object?

Waiting for someone to help me out.

Terribly thanks!

  • 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-29T05:39:52+00:00Added an answer on May 29, 2026 at 5:39 am

    I found the answer my self.

    There’s another way to get this, because of my condition, I can just predicate the suitable Events objects, and all the way from Events to Week or Month are to-one relationship,

    so once I got the eligible Events,

    I can just get corresponding Weeks and Months by

    theEvent.date.thisWeek or theEvent.date.thisMonth.

    Thanks for your guys,

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

Sidebar

Related Questions

Now I am aware that I probably need to use a ListBox and can
I've never really had the need to use any drag functions until now, so
I have some awk scripts that use gawk from cygwin. Now I need to
I have been using mootools for a year now. I need to use jquery
I have this regex working but now need to allow numbers without the decimal
We have inherited an ant build file but now need to deploy to both
We received access to the environment, but I now need to go through the
I was always using JDBC in JavaSE on single-threaded environment. But now I need
I am using ordinary search functionality in my business controller . but now need
I'm using AndroidHttpClient in my app. Now I need to use Basic authorization for

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.