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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:34:15+00:00 2026-06-18T03:34:15+00:00

when i am getting values from JSON php then i am getting issue for

  • 0

when i am getting values from JSON php then i am getting issue for __NSCFBoolean isEqualToString:

My code is as follow:

- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
        //convert to JSON
        for(id key in res) {
        id value = [res objectForKey:key];

        NSString *keyAsString = (NSString *)key;
        NSString *valueAsString = (NSString *)value;
        //NSCFBoolean
        /*if([value isKindOfClass:[NSNumber class]])
        {
            printf("Number");
        }
        else if([value isKindOfClass:[NSString class]])
        {
            printf("String --- \n");
            if([value isEqualToString:@"0"])
            {
                printf("Wrong \n");
            }
            else
            {
                printf("Right \n");
            }
        }*/
        NSLog(@"%@",[valueAsString class]);
        if([keyAsString isEqualToString:@"success"])
        {
            printf("Working \n");
        }
        else
        {
            printf("Not Working\n");
        }
        //Error is in below line
        if([valueAsString isEqualToString:@"0"])// strcmp([value objCType], @encode(BOOL)) == 1)
        {
            [self loginSuccess];
        }
        else if(strcmp([value objCType], @encode(BOOL)) == 0)
        {
            [self loginFailure];
        }
        NSLog(@"key: %@", keyAsString);
        NSLog(@"value: %@", valueAsString);
    }

}
}

Getting issue of [__NSCFBoolean isEqualToString:]: unrecognized selector sent to instance 0x1dc9964

Searching Google for this issue from yesterday, But No solution yet. NSCFBoolean is also not available in iOS 6.0, now. So what could i do to check “0” or “1” from JSON string? Please help.

  • 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-18T03:34:17+00:00Added an answer on June 18, 2026 at 3:34 am

    value is a NSNumber object (__NSCFBoolean, because NSNumber is a class cluster) and not a string! Use [value boolValue] to determine whether it’s 0 or 1.

    Casting an object doesn’t change it’s type!

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

Sidebar

Related Questions

So, I'm getting a bunch of string values from a JSON object and then
We have a complete code for getting the values from PHP through Jquery AJAX
I'm still searching solution for getting values from dynamic created object. Follwing code generates
I am getting the values from database as an array <?php foreach($this->getlist as $value){
i am getting a json response from a php host {uid:0} i want to
This block of code is getting data from a csv, putting it into JSON
I am getting the value from my JSON like so: $adarray = json_decode($addata); if($adarray->{'zone'}
In the below program,i am not getting values from printf . #include<stdio.h> int main()
I have a method for getting values from database. public virtual List<TEntity> GetValues( int?
Im getting 2 values from a table and I'd like to compare them. If

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.