Das Programm stürzt ab, wenn mehr als 200 Unteransichtsbilder in UIScrollView geladen werden
Ich entwickle mit ALAssetLibrary ein ähnliches Programm wie Photos auf dem iPhone. Ich versuche die Bilder in einer Scrollansicht zu laden. Alles funktioniert gut, wenn das Album eine kleine Anzahl von Bildern enthält. Beim Versuch, das Album mit mehr als 200 Fotos zu laden, wurde mein Programm jedoch ohne Fehlermeldung beendet. Kennt jemand dieses Programm? Hier ist mein Code zum Laden der Scroll-Ansicht:
- (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];
}
Vielen Dank im Voraus!!!