You can do that by,
create an array (List) of places to be shown ... add object in array !
NSArray *list;
NSArray *listFiles;
2.Filter the content ..
-(void)filter :(NSString *) match1
listFiles = [[NSMutableDictionary alloc] init];
NSPredicate *sPredicate = [NSPredicate predicateWithFormat:@"FullName BEGINSWITH[c] %@", match1];
listFiles = [[ContactDect filteredArrayUsingPredicate:sPredicate ] mutableCopy];
f_name_array=[[NSMutableArray alloc]init];
for (NSDictionary *d in listFiles) {
[self.f_name_array addObject:[d objectForKey:@"FullName"]];
}
list=f_name_array;
NSLog(@"%@",list);
}
- then count list in numberOfRowsInTableview :
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [listFiles count];
}
- cellForRow ::::
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"abccell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
cell.textLabel.text = [NSString stringWithFormat:@"%@" ,[listFiles objectAtIndex:indexPath.row]];
return cell;
}
Call the Filter method while editing textFeild !
[self filter:textfeild1.text];
I wish it will help you .....