я следующий код в viewdidloadКак Impliment панель поиска в режиме Таблица для контактов в ИО
totalstring=[[NSMutableArray alloc]initWithObjects:@"a",@"b",@"c",@"d",@"e",@"f",@"g",@"h",@"i",@"j",@"k",@"l",@"m",@"n",@"n",@"o",@"p",@"q",@"r",@"s",@"s",@"t",@"u",@"v",@"w",@"x",@"y",@"z", nil];
indid=indidvalue1;
NSLog(@"the ind id value is %@",indid);
serviceCall=[[Services alloc]init];
NSString *[email protected]"ContactDetails";
NSDictionary *contactsDisplayDetails1 [email protected]{@"IND_ID":indid};
[serviceCall ContactsDisplayUrl:contactsDisplay1 ContactsDisplayDetails:contactsDisplayDetails1];
[serviceCall setDelegate:self];
код implimenting Строка поиска
{
filteredstring =[[NSMutableArray alloc]init];
for (NSString *str in totalstring)
{
NSRange stringrange =[str rangeOfString:searchText options:NSCaseInsensitiveSearch];
if(stringrange.location!= NSNotFound)
{
[filteredstring addObject:str];
}
}
}
[tableView reloadData];
код для просмотра таблицы
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:simpleTableIdentifier];
}
if (tableView == self.searchDisplayController.searchResultsTableView)
{
cell.textLabel.text = [searchResultsArray objectAtIndex:indexPath.row];
} else
{
UIFont *myfont=[UIFont fontWithName:@"Arial" size:35];
cell.textLabel.text = [contactNameSplitDisplayArray objectAtIndex:indexPath.row];
cell.detailTextLabel.text=[relationTypeSplitDisplayArray objectAtIndex:indexPath.row];
cell.textLabel.font=myfont;
}
return cell;
Как я могу реализовать панель поиска в виде таблицы для контактов в панели рассказов? Я новичок в iOS ? и как реализовать кнопку кнопки и точек в виде таблицы?
проверить это http://www.appcoda.com/ios-contacts -framework/это может помочь вам – sanman
Devi Я разместил здесь весь код. Вы можете использовать. Я реализовал панель поиска с помощью методов-делегатов. Если вы ищете имя (keta, anna, a, n, john, j, h ..... и т. Д.), Он показывает вам результат. Ответ на результат лучше, чем предоставление ссылки. – user3182143