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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:20:20+00:00 2026-05-25T14:20:20+00:00

From the Core Data Programming Guide (my emphasis): By default, Core Data dynamically creates

  • 0

From the Core Data Programming Guide (my emphasis):

By default, Core Data dynamically creates efficient public and primitive get and set accessor methods for modeled properties (attributes and relationships) of managed object classes.

Although I’ve been using Core Data and mogenerator happily since I started on Objective-C, I’ve never had a look at what this means, until an app submission got rejected due to alleged use of private API. Long story about a generated setPrimitiveTypeValue: method, but not what my question is about.

While reading the guide I stumbled on the idea of public and primitive accessors for entity attributes. Another quote, but further down:

For example, given an entity with an attribute firstName, Core Data automatically generates firstName, setFirstName:, primitiveFirstName, and setPrimitiveFirstName:.

What are the primitive accessors for? Is it just so you can assign a BOOL value directly, without wrapping it in an NSNumber? If so, why would mogenerator have gone through the trouble of generating all kinds of <Attribute>Value, set<Attribute>Value:, primitive<Attribute>Value, setPrimitive<Attribute>Value: accessors?

I’m confused, who can help me out?


Related questions:

  • Core Data Primitive Accessors (no answers)
  • why would I need to use a primitive accessor methods in a core data project? (answered)
  • 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-25T14:20:20+00:00Added an answer on May 25, 2026 at 2:20 pm

    As far as I understand it, the primitive method does the actual getting and setting, but does not issue any KVC or KVO notifications (‘willAccessValueForKey‘ and so on). The public method calls the primitive method, but wraps the call in the KVO calls. So from outside the object, you’d typically call the public methods, but if you needed to use the properties of the object for internal reasons (to validate or derive some other property, for example) you would use the primitive methods to avoid firing all the notifications.

    I’d welcome any corrections or clarifications on the answer as it is a subject I am interested in but not fully versed in.

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

Sidebar

Related Questions

From the Core Data Programming Guide: iOS : The XML store is not available
From Apple's Core Data Programming Guide : You should give each thread its own
this is my core data model: I'm trying to get all LanguageEntries from a
Per the Core Data Programming Guide: You can specify that an attribute is optional—that
From the iPhone Programming Guide When creating files or writing out file data, keep
When sorting a table of objects from Core Data, I'd like to set a
I am fetching a set of objects from a Core Data persistent store using
I'm trying to get sorted localized data from a core data model. My code:
my app shows a map with annotations fetched from core data. Currently I do
The situation: I fetch a complete table from my sqllite core data database and

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.