【发布时间】:2015-05-28 18:08:33
【问题描述】:
我在使用 AFNetworking 的应用程序中从来没有遇到过问题,因为我想要显示 20 个图像视图,但现在我的应用程序崩溃了,因为我想将 imagewithURL 设置为 150 个图像视图,如果我评论该行一切正常,这是我的代码:
for (int i=0; i< Array.count; i++) {
UIImageView *imgProd=[[UIImageView alloc] initWithFrame:CGRectMake(margenX, margenY, 220, 330)];
imgProd.contentMode = UIViewContentModeScaleAspectFill;
imgProd.clipsToBounds = YES;
[imgProd setTag:i];
// dispatch_async(dispatch_get_main_queue(), ^{
[imgProd setImageWithURL:[NSURL URLWithString: [Array objectAtIndex:i]]];
// });
imgProd.userInteractionEnabled = YES;
UITapGestureRecognizer *tap ... etc etc.
}
我放了一个dispatch_async,但是同样的问题,请大家指教!,谢谢:)
【问题讨论】:
标签: objective-c uiimageview afnetworking didreceivememorywarning