NSDictionary* dict2 = AppDelegate_Object.MyAssociates[indexPath.row];
NSURL* url = [NSURL URLWithString:dict2[@"Bcode"]];
NSURLRequest* request = [NSURLRequest requestWithURL:url];
[NSURLConnection sendAsynchronousRequest:request
queue:[NSOperationQueue mainQueue]
completionHandler:^(NSURLResponse * response,
NSData * data,
NSError * error) {
if (!error){
UIImage *image = [[UIImage alloc] initWithData:data];
cell.ImageVc.image=image;
}
}];
我在cellForRowAtIndexPath中使用這段代碼來顯示圖像,但是當我滾動表格圖像時,我改變了什麼是做錯了。請幫幫我???cellForRowAtIndexPath方法數據變化
您每次在視圖上出現新的單元格時都會調用URL。每次你滾動,URL被調用。 –
@ Mr.T如何解決這個bug請告訴我 –
這不應該是一個問題,無論如何你都稱之爲異步。網址返回什麼? –