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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:37:57+00:00 2026-06-05T02:37:57+00:00

Possible Duplicate: Images in Uiscroll cell populated by mysql database -(void)getItems { NSString *root

  • 0

Possible Duplicate:
Images in Uiscroll cell populated by mysql database

-(void)getItems 
{
    NSString *root = URL

    NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/phpfile", root]];

    NSURLRequest *request = [NSURLRequest requestWithURL:url];

    AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) 
    {
        [self.object removeAllObjects];

        id results = [JSON valueForKeyPath:@"ids"];

        [results enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) 
        {
            [self.object addObject:[NSString stringWithFormat:@"%@",[obj valueForKey:@"item1"]]];
            [self.object2 addObject:[NSString stringWithFormat:@"%@",[obj valueForKey:@"item2"]]];


-(void)DidLoad
{
    //initializing arrays to hold data

    //Initiate arrays that hold data
    object1 = [[NSMutableArray alloc] init];
    object2 = [[NSMutableArray alloc] init];
    [getItems];
    //Why do I get empty arrays here e.g object 1 and 2 are returning empty ?
  • 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-05T02:37:59+00:00Added an answer on June 5, 2026 at 2:37 am

    Assuming this is your question:

    //Why do I get empty arrays here e.g object 1 and 2 are returning empty ?
    

    This code:

    //Initiate arrays that hold data
    object1 = [[NSMutableArray alloc] init];
    object2 = [[NSMutableArray alloc] init];
    

    Is creating new arrays dynamically on the heap. They are naturally empty because they were just brought into existence.

    This line:

    [getItems];
    

    I think you are trying to call the getItems method you posted above, but you are not referencing an object in the method call. You want:

    [self getItems];
    

    And even then, you still have a problem; assuming the get part of the name is supposed to be getting something (items), you are not returning anything from the method (which is marked with a void return type).

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

Sidebar

Related Questions

Possible Duplicate: Storing Images in DB - Yea or Nay? Images in database vs
Possible Duplicate: How to retrieve and display images from a database in a JSP
Possible Duplicate: img:hover not working in ie .answer_button { background:url(images/answer.png) no-repeat; width: 160px; height:
Possible Duplicate: How to get images from URL in Delphi I'm using Delphi 2010,with
Possible Duplicate: Storing Images in DB - Yea or Nay? For ages I've been
Possible Duplicate: Reading and writing images to an SQLite DB for iPhone use How
Possible Duplicate: Best Way to Sprite Images? Hi i have been using this http://spritegen.website-performance.org
Possible Duplicate: Storing Images in DB - Yea or Nay? i am curios about
Possible Duplicate: How can I merge 3 images into 1 image via PHP? How
Possible Duplicate: PHP image resize on the fly vs storing resized images I was

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.