0
완료 직전에 문제가 발생했지만 배열의 데이터를 정렬하는 정렬 시스템. 나는 그것이 나에게 오류가 있다고 말해 주지만 나는 그것을하기 위해 모든 시스템을 설정했다. 여기서 문제가되는 코드 조각이며 준다 오류 : 그것이 말하는 오류 환자에 있습니다정렬 UITableView가 작동하지 않습니다
NSArray *filteredArray = [[patients filterUsingPredicate:search] sortedArrayUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]];
과는 말한다 :
- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIndentifier = @"cell";
UITableViewCell *cell = [tv dequeueReusableCellWithIdentifier:cellIndentifier forIndexPath:indexPath];
NSString *letter = [charIndex objectAtIndex:[indexPath section]];
NSPredicate *search = [NSPredicate predicateWithFormat:@"patientName beginswith[cd] %@", letter];
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"patientName" ascending:YES];
NSArray *filteredArray = [[patients filterUsingPredicate:search] sortedArrayUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]];
if (nil == cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
}
NSLog(@"indexPath.row = %d, patients.count = %d", indexPath.row, patients.count);
Patient *thisPatient = [filteredArray objectAtIndex:[indexPath row]];
cell.textLabel.text = [NSString stringWithFormat:@"%@ %@", thisPatient.patientName, thisPatient.patientSurname];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.textLabel.textColor = [UIColor blackColor];
if (self.editing) {
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
}
return cell;
}
:
Bad receiver type void
이 컨텍스트에서 코드가 일어나는 일이 많고 그렇다면 거기에 길은 둥근 일입니까 ??? 당신은 그 결과의 메소드를 호출 할 수 있도록 사전
. 죄송합니다. – Hive7
다른 코드를 입력 했으므로 대답을 변경했습니다. –
감사합니다. 완벽하게 작동했습니다. – Hive7