새로운 iOS5 TableView 스타일 코드를 사용하고 있지만 문제가있는 것 같습니다. searching = true 함수가 호출 될 때마다 충돌합니다. 나는 그것을 triyng UITableView 객체를 구성 메소드에 전달하는 것이 BadgedCell을 허용한다고 생각한다. 어떤 아이디어가 이것을 고치는 방법?UITableViewCell에 문제가 발생했습니다.
Crash says: 2011-10-25 22:21:04.973 Social[5719:707] -[__NSCFDictionary isEqualToString:]: unrecognized selector sent to instance 0x392510
2011-10-25 22:21:04.975 Social[5719:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary isEqualToString:]: unrecognized selector sent to instance 0x392510'
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if(searching)
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SearchCell"];
[self configureCell:cell atIndexPath:indexPath];
return cell;
}
else
{
TDBadgedCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BadgedCell"];
[self configureCell:cell atIndexPath:indexPath];
return cell;
}
}
- (void)configureCell:(TDBadgedCell *)cell atIndexPath:(NSIndexPath *)indexPath
{
if(searching)
{
NSDictionary *dictionary = (NSDictionary *)[listOfItems objectAtIndex:indexPath.row];
[cell.textLabel setText:[dictionary objectForKey:@"exerciseName"]];
[cell.detailTextLabel setText:[dictionary objectForKey:@"muscleName"]];
cell.textLabel.text = [listOfItems objectAtIndex:indexPath.row];
cell.detailTextLabel.text = [listOfItems objectAtIndex:indexPath.row];
}
else
{
cell.textLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:16];
cell.textLabel.text = [[self.muscleArray objectAtIndex:indexPath.row]objectForKey:@"muscleName"];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
}