2012-12-10 2 views
0

200 개가 넘는 이미지를 스크롤해야합니다. 자습서 코드로 1000 개가 넘는 이미지를 만들 수 있다고 설명하는 자습서를 찾았습니다. 튜토리얼은 다음과 같습니다 이미지 스크롤, 메모리 경고

http://soulwithmobiletechnology.blogspot.com.br/2011/05/how-to-load-1000s-of-uiimageview-on.html?m=1

내가 튜토리얼을 따라,하지만 난 100 개 이미지 메모리 경고 aprox..the 응용 프로그램 충돌을 사용하는 경우.

내 코드는 여기에 있습니다 : initWithContentsOfFile

그러나 문제와

http://pastebin.com/BKmsdXxf

내가 UIIMagenamed에 이미이 유지됩니다. Pls, 도와주세요!

+0

어떤 sugestion ?? – Ladessa

답변

0

나는 fixeed!

- (void)scrollViewDidScroll:(UIScrollView *)scrollView 
{ 
CGPoint scrollOffset=scrollView.contentOffset; 
int pagAtual = scrollOffset.x/scroll.frame.size.width; 
if(pagAtual != 0) { //always release all imageViews and load the current and next 
for(int iCnt = 0; iCnt < [scroll.subviews count]; iCnt++) { 
    UIView *viewLiberar = [scroll.subviews objectAtIndex:iCnt]; 
if ([viewLiberar isKindOfClass:UIImageView.class]) { 
    [viewLiberar removeFromSuperview]; 
    viewLiberar = nil; 
    } 
} 
} 

if(pageOnScrollView < ((int)scrollOffset.x/scroll.frame.size.width)) 
{ 

//load the next page 
[self loadNextPage:(pagAtual)]; 
[self loadNextPage:(pagAtual + 1)]; 
} 
else if(pageOnScrollView > ((int)scrollOffset.x/scroll.frame.size.width)) 
    { 
    if(pagAtual>0)[self loadNextPage:((int)scrollOffset.x/scroll.frame.size.width)-1]; 
    } 

    pageOnScrollView=scrollOffset.x/scroll.frame.size.width; 
     }