UIScrollView: Freezes then Crashes

Discussion in 'iOS Programming' started by tvassila, Oct 20, 2008.

  1. tvassila macrumors newbie

    Oct 20, 2008
    The example code , PageControl, has been changed to show image views. It always fails when you scroll to the 53rd image. Just hangs then eventually exits. What I notice is that it gets very slow about two images before failure. I wonder if you could try it and see if it happened to you too and maybe you can see any debugging information.

    Now the code is a bit of a hack. So there could lots or problems.

    I thought at first it was that I was running out of memory. 65 images at about 22k each - more than 1.5 meg, so I reduced them to 12k each, but the app just failed in the same place. With the profile, things seem reasonably sensible, i.e.. 65 image objects, 65 views, 1 scroller, etc. Except I haven't really understood how to use it, and memory seems to be growing all the time - even when I don’t do anything!

    So then I thought it might be a corrupted image so I swapped all them around, but no luck.

    Tonight I will refractor it to recycle the viewers, but still if it was memory it should crap out later when the images are smaller and sooner when the are bigger.
    Also I tried preloading all the images, views, etc into an array. The behavior stayed the same, at around the 53rd it crapped out.

    I also tried the scrolling example and plugged it with my 65 images (it uses 4) with no change in the code. This dies at around the 25th page!

    Whets interesting is none of them die when I load the scrollview with the 65 subviews. I would image its at this time that the memory is loaded and not when you scroll to a new page. For then all you are doing is moving the clipping origin.

    Any views or help would be great.

    os: 2.1
    iphone: original.
  2. nimisis macrumors newbie

    Oct 29, 2009
    It's now OS 3.0 and still the same problem

    Hi, just seen this post and I've been having the same problem. No joy! Did you happen to solve this by any chance?

Share This Page