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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:31:56+00:00 2026-05-27T13:31:56+00:00

I am having trouble getting a UIImage to display instantly after the app has

  • 0

I am having trouble getting a UIImage to display instantly after the app has finished loading and displays the first view controller. There is a delay in the displaying of the image due to it being downloaded from the web. Is there any method that gets called before applicationDidFnishLaunching so the image can be downloaded and displayed instantly ?

Here is the code that I am using to download the images:
In delegate, this method is called in appDidFinishLaunching:

-(void)downloadImages {

    NSString *mainImagesJSON = [[NSString alloc]initWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"mainImagesJSON.php"]]encoding:NSUTF8StringEncoding error:nil];
    SBJsonParser *parser = [[SBJsonParser alloc]init];

    NSDictionary  dictionary1 = [[parser objectWithString:mainImagesJSON error:nil]mutableCopy];


    mainImagesArray = [[dictionary1 valueForKey:@"imgSrc"]mutableCopy];

    NSString *imagesTablePath = [mainImagesArray objectAtIndex:0];
    NSURL *imgURL = [NSURL URLWithString:imagesTablePath];

    NSData *imageData = [NSData dataWithContentsOfURL:imgURL];
    UIImage *image1 = [UIImage imageWithData:imageData];

    imageStorageArray = [[NSMutableArray alloc]init];

    [imageStorageArray addObject:image1];



}

Then in first viewController.m :

AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
UIImage *image1 = [[delegate imageStorageArray]objectAtIndex:0];
[mainHomeImageView setImage:image1];
  • 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-27T13:31:56+00:00Added an answer on May 27, 2026 at 1:31 pm

    Generally speaking, it is not a good idea to execute time consuming code in the applicationDidFinishLaunching method as if it takes too long to launch, your app will be killed.

    You could display a placeholder image (from project resources) while your image downloads from the web, then replace it with the proper image once it’s been downloaded.

    I also suggest you look at SDWebImage framework, which is a great framework for downloading and caching images.

    This library provides a category for UIImageVIew with support for
    remote images coming from the web.

    It provides:

    An UIImageView category adding web image and cache management to the Cocoa Touch framework
    An asynchronous image downloader
    An asynchronous memory + disk image caching with automatic cache expiration handling
    A guarantee that the same URL won't be downloaded several times
    A guarantee that bogus URLs won't be retried again and again
    Performances!
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble getting any information to display from this query. Anyone know where
Having trouble getting my local IIS7 running C # MVC app to connect to
I'm having trouble getting my app to install on a tablet through the market.
Having trouble getting the javascript alert to display from my code behind. c# -
I'm having trouble getting a rails app on Dreamhost's Passenger to see compiled libraries
I'm having trouble getting my head around sending multiple models to a view in
Having trouble getting the django-socialregistration app running properly. We were able to get the
Im having trouble getting the following to display in ie6, everything works find in
Hi guys I'm having trouble getting my code to correctly display html within the
Having trouble getting my form to UPDATE records in my database even after searching

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.