ALAssetLibrary を使用して、iPhone の写真のような同様のプログラムを開発しています。スクロールビューに画像を読み込もうとしています。アルバムの写真が少ない場合は、すべて正常に機能します。しかし、200 枚以上の写真を含むアルバムを読み込もうとすると、プログラムはエラー メッセージなしで終了しました。この番組知ってる人いますか?スクロールビューをロードするための私のコードは次のとおりです。
- (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];
}
よろしくお願いします!!!