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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:03:04+00:00 2026-05-29T04:03:04+00:00

I am new to Objective C and IOS programming so please be patient with

  • 0

I am new to Objective C and IOS programming so please be patient with me.

I am getting a JSON string from my server which I am using to add images or buttons to my view my view is a UIScrollView,

The below code works great and does exactly what I want but I only see all the buttons once the loop is completed which takes some time.

What I was expecting is to see each button being added to the view one by one. Is there a better way to implement this and or is this the expected behavior for this as I described.

Thank You

for (NSDictionary *num in jsonOBJ) {

        fullURL = [urlWithOut stringByAppendingString:[num objectForKey:@"src"]];

        img = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL: [NSURL URLWithString:fullURL]]];
        button = [UIButton buttonWithType:UIButtonTypeCustom];
        button.frame = CGRectMake(3+i*h, 3+i*w,76, 76);
        button.layer.borderWidth = 1.0;
        button.layer.borderColor = [UIColor redColor].CGColor;

        [button addTarget:self action:@selector(push:) forControlEvents:UIControlEventTouchUpInside];

        [self.scroll addSubview:button];

        [button setImage:img forState:UIControlStateNormal];
        [img release];

        NSString *string = @"";
        NSString *realstring = [string stringByAppendingString: [num objectForKey:@"id"]];

        button.tag = [realstring intValue];

        self.scroll.contentSize = CGSizeMake(320,total);
    }
  • 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-05-29T04:03:05+00:00Added an answer on May 29, 2026 at 4:03 am

    You need to run image loading process in background thread, that should solve it. I’ll explain – image loading stops the UI while loop actually is still running, adding buttons with images, but they won’t display until all images are loaded.

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

Sidebar

Related Questions

I am fairly new to Objective-C and iOS programming, and I am having lots
I am fairly new to Objective C and iOS programming but am constantly trying
Firstly, be gently with me. I'm new to Objective C and iOS programming. I've
fairly new to Objective-C and iOS development (coming from PHP) and I have a
So I am fairly new to objective C and iOS programming. I am learning
I'm new to objective-C programming for iOS. I'm struggling with a really simple task,
I am new to Objective C and iPhone development. I am using CoreData on
I am new to Objective C. having spent couple of months in iOS, I
im new to IOS and Objective-C and the whole MVC paradigm and i'm stuck
Recently I've begun to code in Objective-C for iOS 5 devices. My brand new

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.