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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:10:15+00:00 2026-05-27T04:10:15+00:00

I recently ran into a problem with dynamically (lazy) loading images within elements (UIViewController-Subclasses)

  • 0

I recently ran into a problem with dynamically (lazy) loading images within elements (UIViewController-Subclasses) that are placed within a UIScrollView.

The Situation is as follows:

  • a large amount of books with their bookcovers need to be displayed in a horizontally-scrollable scrollview
  • due to memory constraints i recycle the book elements; I use a set of 30 book-Instances and re-set their location within the UIScrollView when a didScroll-Delegate methode is being called.
  • upon re-seting the frame of the book-element it will also be updated with new content (new book information)
  • upon updaten a book-element, the book-cover-image fades out, starts a thread that loads an image from the web and once finished, set’s the image into the UIImageViewController’s image property.

so far so good, lazy-loading works great, and the re-use of my book-elements works as well…

the problem is that the asynchronously loaded images will only be displayed once the UIScrollview finished its scrolling animation.

I’ve already tried things like setNeedsDisplay (once the image finisehd loading). But it didn’t really help at all…

I hoope you guys have some advice for me….

thanks,
sam

  • 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-27T04:10:15+00:00Added an answer on May 27, 2026 at 4:10 am

    You have to set the NSURLConnection to call its delagate on the main run loop so the UI can be updated. Check out the NSURLConnection class reference and search for:

    - (void)scheduleInRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode
    

    Code should look like:

    urlConn = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:NO];
    
    [urlConn scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
    
    [urlConn start];
    

    Setting the connection run loop mode to NSRunLoopCommonModes when fetching images gives the delegate the ability to update the UI while the main run loop is in a UI event tracking mode, e.g. when a tableview or scrollview is being scrolled.

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

Sidebar

Related Questions

I recently ran into a problem that I thought boost::lambda or boost::phoenix could help
I recently ran into a problem with a COM object that was using a
A problem I recently ran into was that when trying to update a field
I have recently ran into a problem that would not allow me to use
I ran into a problem recently and found out that this is a bona-fide
I'm writing a C parser using PLY, and recently ran into a problem. This
Here's a problem I ran into recently. I have attributes strings of the form
I recently ran into a quite complex problem and after looking around a lot
I recently started programming my first Cocoa app. I have ran into a problem
I've began working with asp.net mvc very recently and I've ran into a problem.

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.