我有這樣this.`如果tableview從字典中加載,如何實現搜索欄?
NSDictionary *memberInfo = [self.currentChannel infoForMemberWithID:memberID];
memberinfo=memberInfo;
cell.textLabel.text = [NSString stringWithFormat:@"%@",[memberinfo objectForKey:@"name"]];
cell.detailTextLabel.text = [NSString stringWithFormat:@"%@",[memberinfo objectForKey:@"status"]];
cell.textLabel.backgroundColor = [UIColor clearColor];
cell.detailTextLabel.backgroundColor = [UIColor clearColor];
return cell;
`表格視圖,將項目添加到這一點,這是工作fine.Now我想添加一個搜索欄,以that.i需要根據加載的tableview匹配string.But我加載像this.I的實現代碼如下知道如何在array.I搜索正在使用
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText.i want to load the table view according to the match of the searchstring ,Can anybody know this?
你有多少行在這裏..如何保持這一點。 – vishy
@vishy的意思?我有成員算作行號 – hacker
意味着你有n個對象的字典,和n個行..? – vishy