NSAriction의 NSArray를 가지고 있는데,이 배열에는 UITableView에 표시하고 싶지 않은 몇 가지 값이 있습니다.이 셀을 반환하는 것을 피하는 방법을 알고 싶습니다. tableView : cellForRowAtIndexPath :UITableviewCell을 반환하지 않는 방법
나는 return nil;
을 시도했지만 이로 인해 오류가 발생했습니다.
이 어떤 도움을 주시면 감사하겠습니다
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
CustomInstallCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[CustomInstallCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
// Configure the cell...
cell.selectionStyle = UITableViewCellSelectionStyleGray;
currentInstallDictionary = [sortedItemsArray objectAtIndex:indexPath.row];
NSNumber *tempDP = [currentInstallDictionary objectForKey:@"dp"];
NSInteger myInteger = [tempDP integerValue];
if (myInteger == 0) {
return cell;
}
return nil; // gives error
}
처럼 내 코드는 모습입니다.