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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:44:14+00:00 2026-05-24T01:44:14+00:00

My app, using scrollview that loads multiple images with NSOperation (Max around 100sh). I

  • 0

My app, using scrollview that loads multiple images with NSOperation (Max around 100sh). I tried to test it out on my ipod 2Gen and it crashes due to low memory on device, but works fine on ipod 4th Gen. On 2nd Gen, it crashes when it loads about 15-20 images. How should I handle this problem ?

  • 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-24T01:44:15+00:00Added an answer on May 24, 2026 at 1:44 am

    You could load you images lazily. That means, e.g., just a couple of images at a time in your scroll view, so that you can animate to the next and the previous one; when you move to the right, e.g., you also load one more image; at the same time, you unload images that are not directly accessible anymore (e.g. those that have remained to the left).

    You should make the number of preloaded image sufficiently high so that the user can scroll without waiting at any time; this also depends on how big those images are and where they come from (i.e., how long it takes to load them)… a good starting point would be, IMO, 5 images loaded at any time.

    Here you will find a nice step by step tutorial.

    EDIT:

    Since the link above seems to be broken, here is the final code from that post:

    -(void)scrollViewDidScroll:(UIScrollView *)myScrollView {
    
    /**
     *  calculate the current page that is shown
     *  you can also use myScrollview.frame.size.height if your image is the exact size of your scrollview
     */
    int currentPage = (myScrollView.contentOffset.y / currentImageSize.height);
    
    // display the image and maybe +/-1 for a smoother scrolling
    // but be sure to check if the image already exists, you can do this very easily using tags
    if ( [myScrollView viewWithTag:(currentPage +1)] ) {
        return;
    }
    else {
        // view is missing, create it and set its tag to currentPage+1
    }
    
    /**
     *  using your paging numbers as tag, you can also clean the UIScrollView
     *  from no longer needed views to get your memory back
     *  remove all image views except -1 and +1 of the currently drawn page
     */
    for ( int i = 0; i < currentPages; i++ ) {
        if ( (i < (currentPage-1) || i > (currentPage+1)) && [myScrollView viewWithTag:(i+1)] ) {
            [[myScrollView viewWithTag:(i+1)] removeFromSuperview];
        }
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a view hierarchy that is layed out as follows: parentView scrollView contentViewA
I'm building app using GAE and wanted to use Django for that. Which patch
We are building an app using the MVVM pattern, we have controllers that wire
In my app i am using ScrollView for scrolling the ImageView , and i
normally when I'm using a viewcontroller that will push the current viewcontroller out of
I'm writing an app using asp.net-mvc deploying to iis6. I'm using forms authentication. Usually
I have an app using PHP and the PayPal API. The basic way it
I'm making an App using Adobe Flex/Air. I was wondering if there is any
I have an app using a ListView as a main screen. Each row displays
I have an iPhone app using a UINavigationController. On the fourth controller of the

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.