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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:46:05+00:00 2026-06-13T00:46:05+00:00

I am using a large picture (2000×2000, 500kb) as a background image for most

  • 0

I am using a large picture (2000×2000, 500kb) as a background image for most of the View Controllers in my iPad app.

The problem is that the app seems to freeze on the parent ViewController while loading the child ViewController with such an image for the first time (later it’s faster due to caching I assume).

I would load it in a separate thread, and show some indicator while it’s loading, however I know that all UI related operations should be done on the main thread.

Is there a way how I could improve the user experience, so the app does not seem to freeze for approx. 2sec? (tiling the image is not an option in my case)

  • 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-13T00:46:06+00:00Added an answer on June 13, 2026 at 12:46 am

    It is wrong that all UIKit operations should be done on the main thread! Only operations that do drawing should be executed on the main thread. It is totally save to load a UIImage in a separate thread and hand it over to the main thread after that. However I don’t think that the loading takes that long. I think this might be the drawing that takes the time.

    But: As a UIActivityIndicatorView is running in it’s own thread (as all CoreAnimation animations), it keeps animating, even if you block the main thread after the indicator is added. Try this:

    UIActivityIndicatorView* activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
    [activityIndicator startAnimating];
    [self addSubview:activityIndicator];
    
    dispatch_async(dispatch_get_main_queue(), ^{
        UIImage* image = [UIImage imageNamed:@"MyImage"];
        UIImageView* imageView = [[UIImageView alloc] initWithImage:image];
        [self addSubview:imageView];
    
        [activityIndicator removeFromSuperview];
    });
    

    This starts a UIActivityIndicator and begins loading the image in the next run loop cycle. After the image is added, it removes the superview. Maybe you have to dispatch the removal of the activity indicator again, so that UIKit has the time to draw the image. In this case, but the [activityIndicator removeFromSuperview] in another dispatch_async to the main queue within the first block.

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

Sidebar

Related Questions

I am using this url to retrieve Facebook profile picture. http://graph.facebook.com/+ Id +/picture?=large The
I'm making an app for 1.6 and I'm having a problem with android image
I'm working on a picture select/crop program and using this code below: http://www.androidworks.com/crop_large_photos_with_android/comment-page-1#comment-969 As
I am using large random numbers as keys (coming in from another system). Inserts
I'm using a large (thousands of source files) public project with minor (a dozen
I am using a large JS library to perform certain drawing operations in canvas.
In a Cocoa application, I am using a large number of Text Field with
I am creating a fairly large application using Flask and Jinja. Flask recommends separating
I am reading a very large file using a NSInputStream and sending them to
I am trying to verify the content of a large list using Robotium, and

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.