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
섹션이 있습니다. – Sneezy
해결책을 찾았습니다 – Sneezy