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

The Archive Base Latest Questions

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

I encountered a strange problem regarding CoreData and boolean values: In my data model

  • 0

I encountered a strange problem regarding CoreData and boolean values:
In my data model I have set an entity’s property to BOOL. Later I set theEntity.theBooleanValue = [NSNumber numberWithBool:NO] and save the object. So far so good, but when I try to check for the saved property’s value with if ([theObject valueForKey:@"theBooleanValue"] == [NSNumber numberBOOL:NO]){//do something} it never jumps into the if clause. But if I check for == [NSNumber numberWithInt:0] its working… so basically I try to save a bool but it’s recognized as an int… Any ideas what’s going on there?

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

    It makes more sense to examine [[theObject valueForKey:@"theBooleanValue"] boolValue] for me. i.e.,

    if(![[theObject valueForKey:@"theBooleanValue"] boolValue])
    {
        // Your code
    }
    

    I think == operator compares the object pointer, and not the number itself. To compare number there is a separete method [NSNumber isEqualToNumber:].

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

Sidebar

Related Questions

We have encountered a very strange class not found problem in our web app
I have just encountered very strange problem - my GWT app hosted on Google
I've encountered a strange problem in Sql Server. I have a pocket PC application
Going deeper in C#, I have encountered a little (strange) problem with object reference
I have encountered a strange behavior of BindingSource. First I set it's DataSource in
I have encountered strange problem. I have created simple Flash text field control and
I encountered a strange problem where in I have developed 3 reports in SSRS
I have encountered a strange problem when using the File.Move command. The Programm actually
I have encountered a strange problem where if I call getString(R.string.somestringname) , from time
I have encountered a very strange problem in using jQuery load() . I used

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.