我努力解决应该是一个非常简单的问题,交叉手指将能够识别我的错误或提出更好的方法。
我要做的是从数组中检索多个 URL,然后为每个条目启动一个异步图像请求。这些请求将返回一个 UIView 对象,然后我将它们添加到另一个数组以供稍后在应用程序中使用。
它不起作用,我猜我的问题与循环初始化 AsyncImageView、分配给新数组以及进一步初始化的方式有关。
for (iccAssociatedMediaObject *media in self.mediaArray) {
if ( [media.usage isEqualToString:@"360"]) {
// >> Here we have the array entry we need this is a URL string
NSLog(@"URL : %@", media.href);
// >> Next I start an Async load of the images, a UIView is returned/created...
HJManagedImageV *asyncImageView = [[HJManagedImageV alloc] initWithFrame:CGRectMake(0, 0, 620, 620)];
[asyncImageView setBackgroundColor:[UIColor grayColor]];
[asyncImageView showLoadingWheel];
[asyncImageView setContentMode:UIViewContentModeScaleAspectFill];
[asyncImageView.imageView setContentMode:UIViewContentModeScaleAspectFill];
asyncImageView.url = [NSURL URLWithString:media.href];
// asyncImageView.callbackOnSetImage = (id)self;
// >> Next I add the UIView (asyncImageView) to an array for use later in the app
[objMan manage:asyncImageView];
// >> I think my problem relates to the HJManagedImageV initialization & reuse?????
}
}