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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:23:17+00:00 2026-05-20T09:23:17+00:00

I am creating a application which displays 8 thumbnails per page and it can

  • 0

I am creating a application which displays 8 thumbnails per page and it can have n pages. Each of these thumbnails are UIViews and are added to UIScrollView. However i have implemented Paging using the Apple sample code.

The prob:

  1. Each thumbnail(UIView) takes 150
    millisecs to be created and added to
    scroll view
  2. Hence for 3 pages it takes awful
    huge time to be created and added to
    the UI Scrollview.
  3. At this point the scroll view is not very respsonsive and it is very jerky and gives a bad user experience
  4. How can i create the thumbnails and add them to UIScrollview without affecting the touch responsiveness? I want them to run independent of the main thread which is resposible for handling touch events (i suppose).

Also i would like to mention that when a thumbnail is created i trigger a Async download of the image and the delegate method is called when download is complete.

Let me know the the options i have to make this more responsive and update UI without affecting the touch operations. The page control works fine with lazy loading of the grid of thumbnails.

TIA,

Praveen S

  • 1 1 Answer
  • 3 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-20T09:23:18+00:00Added an answer on May 20, 2026 at 9:23 am

    Grand Central Dispatch is easy to use for background loading. But GCD is only for after iOS4. If you have to support iOS3, performSelectorInBackground/performSelectorOnMainThread or NSOperationQueue are helpful.

    And, be careful almost UIKit classes are not thread-safe except drawing to a graphics context. For example, UIScrollView is not thread-safe, UIImage imageNamed: is not thread-safe, but UIImage imageWithContentsOfFile: is thread-safe.

    dispatch_queue_t mainQueue = dispatch_get_main_queue();
    dispatch_queue_t concurrentQueue =
        dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
    
    dispatch_async(concurrentQueue, ^{
    
        dispatch_apply([thumbnails count], concurrentQueue, ^(size_t index) {
    
            Thumbnail *thumbnail = [thumbnails objectAtIndex:index];
            thumbnail.image = [UIImage imageWithContentsOfFile:thumbnail.url];
    
            dispatch_sync(mainQueue, ^{
    
                /* update UIScrollView using thumbnail. It is safe because this block is on main thread. */
    
            });
        }
    
        /* dispatch_apply waits until all blocks are done */
    
        dispatch_async(mainQueue, ^{
            /* do for all done. */
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating an application which displays map using MKMapView control. I have a
I am creating an application which displays several pages of content. Typically this is
i am creating an application which includes dynamic pages. actually, i created some dynamic
I'm creating an application which works on Froyo until Jelly Beans. I have two
I am creating Facebook application which get insights for user's page for multiple metric.
I'm creating a little Java application which should have a progress indicator with percentages.
I Am creating an iPhone application which displays an UITableView at the start with
I am creating an application which displays the market data and uses it in
I am creating an application using javascript/HTML for windows 8 which basically displays text
I am creating a web application using EJBs and servlets. I have a page

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.