i have a array containing dictionary ,i want to show the value in table view according to name field in dictionary suppose if name start with a,b ,c are in different section..,there are number of section according to the name field of dictionary ..here i am not able to do ho i get the number of row.. if any one know plz give then solution...
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
//---get the letter in each section; e.g., A, B, C, etc.---
NSString *alphabet = [subscribeIndexArray objectAtIndex:section];
//---get all states beginning with the letter---
//NSMutableArray *states =[[NSMutableArray alloc]init];
NSArray *states;
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF beginswith[c] %@", alphabet];
for(NSDictionary *dict in subscribeViewArray1)
{
states =[[dict valueForKey:@"name"] filteredArrayUsingPredicate:predicate];
}
//---return the number of states beginning with the letter---
return [states count];
}