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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:57:14+00:00 2026-06-14T23:57:14+00:00

I have used the AFJSONRequest item in my app and the data it returns

  • 0

I have used the AFJSONRequest item in my app and the data it returns in the success portion I want to use in other parts of the view controller. I can’t for the life of me figure it out. I have created a property to hold the data but I can’t access it in other methods. Any reason for this? It’s probably something I’m doing wrong. How do I use the nameArray, emailArray, and passArray in other methods? They are already declared properties. Here is my code:

- (void)viewDidLoad
{
[super viewDidLoad];
NSURL *url = [NSURL URLWithString:@"http://10.247.245.87/it/emailmanager.php"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[AFJSONRequestOperation addAcceptableContentTypes:[NSSet setWithObject:@"text/html"]];
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON)
                                     {
                                         NSLog(@"email.last_name is of type: %@", [[JSON valueForKeyPath:@"email.lastname" ] class]);
                                         nameArray = [JSON valueForKeyPath:@"email.last_name"];
                                         emailArray = [JSON valueForKeyPath:@"email.email_address"];
                                         passArray = [JSON valueForKeyPath:@"email.password"];
                                         NSLog(@"%@", nameArray);
                                     }
                                                                                    failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON)
                                     {
                                         NSLog(@"error %@ %@", [error description], JSON);
                                     }];

[operation start];
}

And here is the rest.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
EMailCell* cell = [tableView dequeueReusableCellWithIdentifier:@"EmailCell"];
cell.nameLabel.text = @"%@", nameArray;
cell.emailLabel.text = @"%@", emailArray;
cell.passLabel.text = @"%@", passArray;
return cell;

}

Here is the structure of the JSON results:

2012-11-13 07:43:46.026 IT Tools[13987:c07] Names: (
        {
    code = 0496;
    department = Management;
    "email_address" = "????@???.com";
    "first_name" = John;
    id = 227;
    "last_name" = Doe;
    password = "T0496)$(^";
    store = Toyota;
},

And the result from the debugger console:
2012-11-13 09:04:37.416 IT Tools[15386:c07] email.last_name is of type: __NSArrayI

  • 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-14T23:57:15+00:00Added an answer on June 14, 2026 at 11:57 pm

    You are assigning arrays to string values. You should loop through the JSON results and create arrays of strings… It would help to know the structure of your JSON results. If you are using core data, there is a handy method for parsing JSON into core data objects.

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

Sidebar

Related Questions

I have used BaseAdapter for grid view, in getView method of BaseAdapter I am
I have used the signalR chat app (as laid out in this tutorial http://sergiotapia.com/2011/09/signalr-with-mvc3-chat-app-build-asynchronous-real-time-persistant-connection-websites/
I have used .NET 3.5 with C# to create functions to gather data from
i have used zend paginator in my app its working fine the way its
I have used tab control for view my usercontrols.. in 1st usercontrol I have
I have Used Tomcat Apache to use my java desktop application as a webservice.so
I have used sessions in my web app. and I sets up sessions on
I have used the smtp class to send emails through code. Can I use
I have used date picker in my iPad App but the output of date
I have used gallery in my app. In that i have two images in

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.