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

The Archive Base Latest Questions

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

I was able to parse a JSON and stored it in a NSMutableArray named

  • 0

I was able to parse a JSON and stored it in a NSMutableArray named as json in my FirstViewController. The problem is, I do not know how to access the array in my FirstViewController from my View Controllers.

EDIT!!!

I moved the code from AppDelegate to my FirstViewController as it is not a good practice.

FirstViewController.h

#import <UIKit/UIKit.h>

@interface FirstViewController : UIViewController
{
    NSMutableArray *jsonData;
}

@property (nonatomic, strong) NSMutableArray *jsonData;

@end

FirstViewController.m

@synthesize jsonData;

NSURL *url = [NSURL URLWithString:@"http://search.twitter.com/search.json?q=coredata"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
self.json = [NSJSONSerialization JSONObjectWithData:response options:0 error:&jsonParsingError];

SecondViewController *secondViewController = [[SecondViewController alloc] init];
secondViewController.secondJSON = [self jsonData];
[[self navigationController] pushViewController:secondViewController animated:YES];

SecondViewController.h

#import <UIKit/UIKit.h>

@interface SecondViewController : UIViewController
{
    NSMutableArray *secondJSON;
}

@property (nonatomic, strong) NSMutableArray *secondJSON;

@end

SecondViewController.m

- (void)viewDidLoad
{
    [super viewDidLoad];

    NSLog(@"%@", [self secondJSON]);
}

Output

2013-02-03 00:16:17.749 Subscription[24669:c07] (null)

Am I missing something?

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

    Perhaps [[[UIApplication sharedApplication] delegate] json]?

    (And please, don’t send synchronous requests on the main thread while the application is launching!)

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

Sidebar

Related Questions

I am not able to parse tje Json object returned from the servlet in
I am not able to parse tje Json object returned from the servlet in
I am not able to parse the json data by the following code, its
i'm not able to parse this json: var _json = [{place_id:18094048,licence:Data \u00a9 OpenStreetMap contributors,
for this json api response I am able to parse with json_decode: $string =
I am trying to get a value from json by using the JSON.parse function.
i try parse json, but i have problem, when i runing my app, i
In my iPhone application I get json data from a remote server, parse it
Using jquery's $.ajax function, I'm not able to parse the results. For example, I
I want to parse the following Json file in Java. But I am not

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.