我從網絡服務中我的cellForRowAtIndexPath使用下面的代碼獲取圖像在指定索引添加到的UIImage的NSMutableArray:通過AFNetworking
[cell.posterImageView setImageWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[postersURLArray objectAtIndex:indexPath.row]]] placeholderImage:[UIImage imageNamed:@"placeholder.png"]
success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image)
{
if (request)
{
[UIView transitionWithView:cell.posterImageView
duration:1.0f
options:UIViewAnimationOptionTransitionCurlUp
animations:^{[cell.posterImageView setImage:image];}
completion:nil];
posterImageView.tag = indexPath.row;
posterImageView.image = image;
[myImage insertObject:posterImageView atIndex:posterImageView.tag];
}
else
{
NSLog(@"Cached");
}
}
failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error)
{
NSLog(@"Failed to fetch poster.");
}];
但它總是產生一個錯誤。我已經分配了myImage可變數組。任何幫助,將不勝感激。謝謝。
什麼是錯誤? – Jeremy 2013-02-27 04:18:49