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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:44:49+00:00 2026-06-11T13:44:49+00:00

I am doing an authentication by using AFNetworking like below AFJSONRequestOperation *operation = [AFJSONRequestOperation

  • 0

I am doing an authentication by using AFNetworking like below

AFJSONRequestOperation *operation   =   [AFJSONRequestOperation JSONRequestOperationWithRequest:request 
                                                                                            success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
                                                                                                // Parsing will be here                                                                                                                                                                                      
                                                                                            {

                                                                                            failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {
                                                                                                NSLog(@"ERROR :jason is %@",JSON);
                                                                                            }];

[client enqueueHTTPRequestOperation:operation];

Below is a JSON which received from server

{
    "first_name" = A;
    "last_name" = B;
}

Question :
How can a parse this JSON in ios. I am stuck because the return from server does not have any tag at all. If its format was

{
  "user": {
    "first_name": "A",
    "last_name": "B",
  }
}

I could parse by doing the following

NSArray  *userList  = [[NSArray alloc] init];
userList            =  [JSON objectForKey:@"results"];

Any ideas?

  • 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-11T13:44:51+00:00Added an answer on June 11, 2026 at 1:44 pm

    “Tag” is not in the terminology of JSON. The complex structure of JSON is negotiated between the sender and receiver (or simply dictated by the sender) and need not follow any particular outline, so long as it parses correctly.

    The first quasi-JSON string you quoted would (if it were valid JSON) presumably identify the first and last name of an individual, and you would presumably know that it was a “user” identity, and what user it identified, from the context.

    In general, you must approach a JSON string as an onion, peeling one layer at a time. In the case of your first string there is only one layer, an “Object” that maps to an NSDictionary. So, having received the object (and, if necessary, verified that it is indeed an NSDictionary using isKindOfClass, you would cast the id value to an NSDictionary and proceed to use objectForKey or some such to access the values within.

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

Sidebar

Related Questions

for the page I am doing needs a login authentication using Twitter (using tweetphp
Doing an ajax get request works as expected using the following code: $.ajax({ type:
After doing authentication using facebook by doing FBSessionLoginBehavior behavior = FBSessionLoginBehaviorForcingWebView; appDelegate.session = [[FBSession
I am doing an app that requires authentication. In the index page of the
I am doing a project which involves authentication and I can't quite grasp the
Doing the below will reproduce my problem: New WPF Project Add ListView Name the
I am using forms authentication and need to get a list of users that
I'm trying to get a test signing in using basic authentication. I've tried a
I'm working on a site that is using Facebook authentication and friends, but I'm
I am trying to connect to an ASP.net soap service using Kerberos authentication using

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.