我目前正在使用UITableview,它从Facebook加载用户墙上的Feed。我遇到的问题是,放入tableview的图像加载得很好但是当用户滚动时,它们会变成完全黑色。这是我的cellForRow方法:
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;
}
感谢您的帮助:)
答案 0 :(得分:1)