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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:05:33+00:00 2026-05-31T17:05:33+00:00

Should I need to have explicit custom ID attribute as PK for each of

  • 0

Should I need to have explicit custom ID attribute as PK for each of my core data entities? I’m aware of the fact core data uses its own objectID column for every entity and we can grab it from [NSManagedObject objectID].

My previous projects were done using raw SQLite, but now I’m trying to move to core data. Currently in my core data prototype, I’m filtering records using my custom ID column:

[fetchRequest setPredicate:[NSPredicate predicateWithFormat:@"my_id=%d",some_id_value]];

Just curious, should I bother myself with custom ID attributes, or should I rely on internal objectID column: pass it here and there, use for filtering, joining tables and etc?

  • 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-31T17:05:34+00:00Added an answer on May 31, 2026 at 5:05 pm

    The whole idea behind coredata is to avoid low-level sql. As in every modern ORM you should not be bothered with internal object ids. At first this may seem a little awkward (especially if you come from a heavy sql background) but believe me it is a lot more easier to manage your object graph this way. So bottom line, design your NSManagedObjects and relationships and let coredata do its magic with all the ids.

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

Sidebar

Related Questions

I have two entities – PopularTutorial and Blog. This data need to be displayed
I need to have a string, based on an integer, which should always have
I have maven-plagin and need to run goal, that should automatically run before plugin.
I need to mock a GrailsControllerClass interface. Instance should have a static variable defined.
Some of my columns need explicit widths, while others should just fill up all
Hey can any one tell me should i need open a port for outgoing
I need to create a panel which should be invisible but the components inside
i need a report and i should use pivot table for it.Report will be
I need JavaScript working almost perfectly in my application that should be able to
I need to transfer packets through the internet whose length should be dynamic. struct

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.