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

  • Home
  • SEARCH
  • 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 9237079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:27:12+00:00 2026-06-18T07:27:12+00:00

I have this: NSURL *url = [NSURL URLWithString:@http://www.ios.com/ios/responseScript.php]; NSError *error = nil; NSURLRequest *request

  • 0

I have this:

NSURL *url = [NSURL URLWithString:@"http://www.ios.com/ios/responseScript.php"];
NSError *error = nil;
NSURLRequest *request = [NSURLRequest requestWithURL:url];
NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:NULL error:&error];
NSMutableArray *someArray = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
NSLog(@"Array Retrieved: %@", someArray);

It clearly gets json data from site. The PHP array is created like this:

$simpleProduct = array("John"=>"Employee","Jane"=>"Student","Jhonson"=>"Somejob","Mike"=>"Nothing");
echo json_encode($simpleProduct);

and when the result of objective-c code above is printed, it shows like:

2013-02-05 19:17:37.910 testProducts[26786:c07] Array Retrieved: {
Jane = Student;
Jhonson = Somejob;
John = Employee;
Mike = Nothing; }

Now I wish to have this data inserted into dictionary (NSMutableDictionary) so that for e.g. Jane is key and Student is value. So on for all other pairs.

How can this be done?

I am new to iOS development 🙂

  • 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-18T07:27:13+00:00Added an answer on June 18, 2026 at 7:27 am

    why not you just get the results like this

    NSDictionary *someDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
    

    it makes your life easier, and after just access the values via keys like this

    NSString *jane= [someDictionary objectForKey:@"Jane"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

NSURL *URL = [NSURL URLWithString:@http://www.stackoverflow.com]; NSURLRequest *request = [NSURLRequest requestWithURL:URL]; NSURLConnection *connection = [NSURLConnection
In my appDelegate in didFinishLaunchingWithOptions, I have the following: NSURL *url = [NSURL URLWithString:@http://www.thejenkinsinstitute.com/Journal/];
i have this youtube url http://www.youtube.com/watch?v=9N51Etoikfw&feature=youtube_gdata i need to remove the feature parameter and
Using this Tutorail i scceessfully login to Facebook http://www.raywenderlich.com/1626/how-to-post-to-a-users-wall-upload-photos-and-add-a-like-button-from-your-iphone-app But i have NO Experience
I have this code: NSString *path = [NSString stringWithFormat:@%@/%@, [[NSBundle mainBundle] resourcePath], @change.mp3]; NSURL
Have this self-made slider: http://jsfiddle.net/wyc3P/4/ What it does: takes min and max values in
I found a page ( http://itunes.apple.com/linkmaker ) to get the iTunes url for a
Possible Duplicate: Testing use of NSURLConnection with HTTP response error statuses This is bizarre;
i have this method - NSArray *objects = [NSArray arrayWithObjects:appDelegate.UserID,itemName.text,@1,@1,itemDegem.text,itemDescription.text, nil]; NSArray *keys =
I have a method like this: - (BOOL)webView:(UIWebView *)aWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { 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.