0
#import "UIImageView+AFNetworking.h"
当我在我的表格中滚动时。细胞改变地点。这就像他不知道第一个细胞是什么样的。当在表格中滚动时,单元格发生更改
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier];
if(indexPath.section == 0)
{
Recipe *dish = [_recipes objectAtIndex:indexPath.row];
cell.textLabel.text = dish.user;
cell.imageView.image = _imageView.image;
return cell;
}
else if (indexPath.section == 1 || indexPath.section == 2)
{
Recipe *dish = [_recipesExtra objectAtIndex:indexPath.row];
cell.textLabel.text = dish.title;
[cell.imageView setImageWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString: dish.url]]
placeholderImage:nil
success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
}
failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error) {
}];
return cell;
}
else
{
return nil;
}
}
我敢肯定,我的错误是在reloadRowsAtIndexPaths,但我不知道如何解决它。
哪些细胞改变的地方?在一个部分或部分之间?任何特定的部分? – jrturton 2012-03-26 11:28:24
Whithin的截面。 – Sneezy 2012-03-26 12:15:19
我找到了解决办法 – Sneezy 2012-03-26 14:20:06