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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:09:48+00:00 2026-06-17T08:09:48+00:00

In core data you can set a relationship to optional but you can set

  • 0

In core data you can set a relationship to optional but you can set it with minimum checked or without… Check the images below for the difference.
What I think I’ve noticed is that when you search for an object using a predicate like:@"object != %@", objectToSearchFor, the first setting returns nil’s but the second setting doesn’t. I can be mistaken about that but does anybody know the difference between the two settings?

Optional relationship without minimum

Optional relationship with minimum

P.s. I don’t know if it matters but I’m using SQLite as DB engine.

  • 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-17T08:09:49+00:00Added an answer on June 17, 2026 at 8:09 am

    There is some documentation about this in the NSRelationshipDescription Class Reference:

    Cardinality
    The maximum and minimum counts for a relationship
    indicate the number of objects referenced (1 for a to-one
    relationship, -1 means undefined). The counts are only enforced if the
    relationship value in the containing object is not nil. That is,
    provided that the relationship value is optional, there may be zero
    objects in the relationship, which might be less than the minimum
    count.

    So for example, in the case of an optional to-many relationship: The value of the relationship must be either nil, or contain at least the minimum count of required objects.

    In the case of an optional to-one relationship, the relationship value either is nil or points to another object, so I cannot think of a situation where it makes a difference whether the minimum count is 0 or 1.

    All the constrains like minimum and maximum count etc. are checked when saving a managed object context.

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

Sidebar

Related Questions

I have a One-To-Many relationship set up in core data. I can View/Add/Remove objects
I'm working with Core Data and a many-to-many relationship: a building can have multiple
Can a Core Data relationship be its own inverse relationship? I have a generalized
I'm new to Core Data and I can't find the answer into the docs
Where I can find Core Data’s sqlite database of Mac OS X application? I
Can I optimize a Core Data query when searching for matching words in a
Can someone walk me through how to 'hide' the standard core data setters? I
I have a Core Data structure with Restaurants and Atmospheres, where a restaurant can
In Core Data of Xcode 4.3.2, an Ordered To-Many relationship is modelled with NSOrderedSet
Tracking a familial relationship in Core Data (1 parent entity + 2 types of

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.