//dblIndex is used for AA,AB,Ac series and else part for A,B,C..
NSSTring *sortVal;
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index {
if(searching)
return -1;
else if(dblIndex) {
return index;
}
else {
dblIndex=YES;
sortVal=nil;
//unichar c = index+65;
//sortVal = (NSString*)c;
[COLOR="DarkOrange"]sortVal=[NSString stringWithFormat:@"%c",index+65];[/COLOR]
[Dictionary arrySortContactsRemoveAll];
[Dictionary showSortContacts:sortVal];
[tblView reloadData];
return 0;
}
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
if(searching)
return @"Search Result";
else if(dblIndex){
NSLog(@"%d",section);
NSArray *dblary =[[Dictionary getarrySortContacts] objectAtIndex:section];
if ([dblary count]==0) {
return nil;
}
[B][COLOR="red"]NSLog(@"%@",sortVal);[/COLOR][/B]
return [NSString stringWithFormat:@"%c",section+65];
}
else {
NSArray *ary =[[Dictionary getarryContacts] objectAtIndex:section];
//NSLog(@"%d",section);
if ([ary count]==0) {
return nil;
}
return [NSString stringWithFormat:@"%c",section+65];
}
}