Я ворую на ios7. В моем приложении у меня есть UITableView и UISearchBar Controller. при реализации UISearchBar контроллера моего сбой приложения БЛАГОДАРЯ следующих причины:ios7 с сбоем UIsearchBarController?
Нагрузочного приложение из-за неперехваченное исключение «NSInternalInconsistencyException», причина: «не удалось из очереди ячейки с идентификатором listcell - должно зарегистрировать перо или класс для идентификатор или соединить прототип ячейки в раскадровке '
Я использую пользовательские методы делегирования UITabelViewCell.UISearchBarController.
Может ли кто-нибудь предоставить мне лучшую ссылку или решение для этого?
Ниже мой код:
// ---------------------- код для поиска части --------- ---------
-(void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope
{
NSPredicate *resultPredicate = [NSPredicate predicateWithFormat:@"SELF Contains[cd] %@",searchText];
searchResults = [_detailList filteredArrayUsingPredicate:resultPredicate];
}
-(BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString
{
[self filterContentForSearchText:searchString scope:[[self.searchDisplayController.searchBar scopeButtonTitles]objectAtIndex:[self.searchDisplayController.searchBar selectedScopeButtonIndex]]];
return YES;
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (tableView == self.searchDisplayController.searchResultsTableView)
{
return [searchResults count];
}
else
return _detailList.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"listcell";
//
ListCell *listcell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
listcell.lbl_detail.text = _detailList [indexPath.row];
listcell.lbl_Address.text = _detailList1 [indexPath.row];
listcell.lbl_link.text = _detailList2 [indexPath.row];
listcell.lbl_number.text = _detailList3 [indexPath.row];
return listcell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[(ContainerViewController *)self.parentViewController addDetailViewController];
}
Благодаря
Вам необходимо установить идентификатор «listcell» в раскадровке. –
can u plz помогите мне с этой проблемой –
Я установил этот идентификатор в раскадровке –