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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:07:08+00:00 2026-06-06T16:07:08+00:00

I am parsing a JSON string: Response: {success:false,displaymessage:UserName or Email already exist. Please try

  • 0

I am parsing a JSON string:

Response: {"success":false,"displaymessage":"UserName or Email already exist. Please try again"}

The code I am using is:

  NSLog(@"Result: %@ %@", [responseObject valueForKeyPath:@"success"]? @"YES" : @"NO", [responseObject valueForKeyPath:@"displaymessage"]);

However my out put is:

Result: YES UserName or Email already exist. Please try again

I should be getting a No. What am I doing wrong?

  • 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-06T16:07:11+00:00Added an answer on June 6, 2026 at 4:07 pm

    The valueForKeyPath: method returns an object, which is always non-nil (hence you’re seeing a YES instead of a NO). If I remember it correctly, booleans are wrapped in NSNumber. You should pull the actual boolean value from the object returned by valueForKeyPath:, like this:

    [[responseObject valueForKeyPath:@"success"] boolValue]? @"YES" : @"NO"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am parsing a json string like so: ring = JSON.parse(response); Now, ring is
I'm having a hard time parsing the below JSON string on iOS 5. {States:
I got below JSON string, i facing issue parsing because it contains non english
I am currently trying to pass a generated JSON string to dojo for parsing
I'm parsing some json to return a basic string token or error message. -
I already looked at a similar question here : null pointer exception-parsing json with
I try to get parse JSON response for the following link: https://graph.facebook.com/feed/?ids=135395949809348,149531474996&access_token= The response
I'm having a problem parsing the JSON response sent from Yahoo! Placemaker. I only
The Google App Engine server is returning a JSON String in response to a
Here's the code for my JSON parsing app. It force closes as soon as

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.