O programa trava ao carregar mais de 200 imagens de subvisualização no UIScrollView
Estou desenvolvendo um programa semelhante ao Photos no iPhone usando o ALAssetLibrary. Eu estou tentando carregar as imagens em uma visão de rolagem. Tudo funciona bem quando o álbum tem pequena quantidade de fotos. Mas quando eu tento carregar o álbum com mais de 200 fotos, meu programa terminou sem nenhuma mensagem de erro. Alguém conhece esse programa? Aqui está o meu código para carregar a visualização de rolagem:
- (void)loadScrollView
{
for (UIView *v in [scrollview subviews]) {
[v removeFromSuperview];
}
CGRect scrollFrame = [self frameForPagingScrollView];
scrollview = [[UIScrollView alloc] initWithFrame:scrollFrame];
CGRect workingFrame = scrollview.frame;
workingFrame.origin.y = 0;
photoCount = [info count];
for(NSDictionary *dict in info) {
UIImageView *imageview = [[UIImageView alloc] initWithImage:[dict objectForKey:UIImagePickerControllerOriginalImage]];
[imageview setContentMode:UIViewContentModeScaleAspectFit];
imageview.frame = workingFrame;
[scrollview addSubview:imageview];
[imageview release];
[scrollview setPagingEnabled:YES];
[scrollview setDelegate:self];
[scrollview setAutoresizesSubviews:YES];
[scrollview setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight];
[scrollview setShowsVerticalScrollIndicator:NO];
[scrollview setShowsHorizontalScrollIndicator:NO];
workingFrame.origin.x = workingFrame.origin.x + workingFrame.size.width;
}
[self setScrollViewContentSize];
[[self view] addSubview:scrollview];
}
Muito obrigado antecipadamente !!!