2
我目前正在從UITableview加載Facebook用戶牆上的飼料。我遇到的問題是,放入tableview的圖像加載正常,但當用戶滾動時,它們會變成完全黑色。這裏是我的cellForRow方法:Uitableview照片顯示然後變黑
if ([[objectTypes objectAtIndex:indexPath.row] isEqualToString:@"photo"]) {
//this is a picture
if ([facebookPictureObjectIDs objectAtIndex:indexPath.row])
{
if ([sourceArray objectAtIndex:indexPath.row]) {
if ([[sourceArray objectAtIndex:indexPath.row] rangeOfString:[facebookPictureObjectIDs objectAtIndex:indexPath.row]].location != NSNotFound) {
imageCell.imageview.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[sourceArray objectAtIndex:indexPath.row]]]];
NSLog(@"source array objectwith image ID: %@",[facebookPictureObjectIDs objectAtIndex:indexPath.row]);
}else {
NSLog(@"Same Image object id is: %@", [facebookPictureObjectIDs objectAtIndex:indexPath.row]);
}
} else {
NSLog(@"Source Array object NIL NIL NIL");
}
}else {
NSLog(@"Else Called");
}
[imageCell layoutSubviews];
returnCell = imageCell;
}
感謝所有幫助:)