mothod cellForRowAtIndexPath
에서 tableView 맨 위에 표시하려면 tableView 셀을 prfioritize하는 방법? havePriority
의 값이 havePriority
인 bool
값에 따라 우선 순위가 있는지 여부를 확인하는 tableView 셀의 맨 위에 우선 순위 셀을 표시하려면 havePriority
이 1 일 경우 true이어야합니다. 그렇지 않으면 우선 순위 목록 뒤에 있어야합니다. . 다른 셀 식별자를 사용하여 시도했지만 상단에서 목록을 가져올 수 없습니다.우선 테이블보기 셀 IOS
내 코드 :
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
if (havePriority) // if the cell wants priority to be at top, have a value in bool
{
cell.textLabel = sOmeText; //
NSLog(@"%@",sOmeText);
}
return cell;
데이터 원본의 우선 순위를 지정한 다음 reloadData를 다시 지정하십시오. –