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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:03:25+00:00 2026-05-15T09:03:25+00:00

I did some little experimentation on this. I created an boolean attribute, named isFault.

  • 0

I did some little experimentation on this.

I created an boolean attribute, named isFault. You know, that’s a method of NSManagedObject and therefore actually not allowed for an attribute name because of KVC.

Simply, I used the default Core Data template for this test, but created the data model programmatically so I can show you what I do.

So here we go:

NSAttributeDescription *badAttr = [[NSAttributeDescription alloc] init];
[badAttr setName:@"isFault"];
[badAttr setAttributeType:NSBooleanAttributeType];
[badAttr setOptional:YES];
// don't want to occupy you with the whole, non-important rest ...

Next, I’ve modified the -insertNewObject method of the controller, added these lines:

// Assume: An managed object is created into the context, but not saved yet...
NSLog(@"isFault = %d", [newManagedObject isFault]); // 0 = NO

BOOL isFault = [[newManagedObject valueForKey:@"isFault"] boolValue];
NSLog(@"isFault = %d", isFault); // 0 = NO

[newManagedObject setValue:[NSNumber numberWithBool:YES] forKey:@"isFault"];

isFault = [[newManagedObject valueForKey:@"isFault"] boolValue];
NSLog(@"isFault = %d", isFault); // 0 = NO

Like you can see, I’m not able to set the isFault attribute to YES. It remains NO. Now, changing the attribute name to isFaultXYZ, will allow that.

So actually, what I wanted to ask is… since this stuff seems to depend on KVC, does the rule only apply to methods that return something and have no parameter? And does it matter what data type is returned? For example, -changedValues has no parameter and returns an NSDictionary. But since there is no attribute type like that, would this cause a collision anyways?

  • 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-15T09:03:26+00:00Added an answer on May 15, 2026 at 9:03 am

    So, here is the evidence. When naming the attribute changedValues, THIS happens after attempting to access it via KVC:

    *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFDictionary boolValue]: unrecognized selector sent to instance 0x1205680'
    2010-06-10 14:52:40.232 CoreData[33996:207] Stack: (
        8035,
        4437,
        8825,
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I did some googling to try to answer this question but even after that
I did some HTTP monitoring with WireShark. Are there more tools like this that
I did some search online. I know that you can use format-patch after commit,
I finished my little project that does some heavy lifting. i realized in this
I did some searching for this, but it's a little too generic to pull
Why did some processor manifacturers decide to use Little endian Big endian Middle endian
Did some googling and couldn't find a clear answer on this. My assumption is
I did some changes and then did a commit. Then I realized that I
after I did some research on the subject, I found that Windows Live stopped
I saw some code yesterday in this question that I had not seen before,

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.