Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 2

- (void) createSectionList: (id) wordArray { for(int j=0;j<[wordArray count];j++) { NSMutableDictionary *dicContact=[wordArray objectAtIndex:j];

word=[dicContact valueForKey:KFirstName]; if ([word length] == 0) continue; // determine which letter starts the name NSRange range = [ALPHA rangeOfString:[[word substringToIndex:1] uppercaseString]]; // Add the name to the proper array // NSLog(@"range value %d",range.location); if(range.location >=0 && range.location<26) { [[sectionArray objectAtIndex:range.location] addObject:dicContact]; if(appDelegate.selectContactForAlert==TRUE) { NSMutableArray *arrAlerts=[appDelegate.dicPlistData valueForKey:KPlistAlerts]; NSMutableDictionary *dicAlertSelect=[arrAlerts objectAtIndex:appDelegate.alertGroupIndex]; NSMutableArray *arrChillListAlert=[dicAlertSelect valueForKey:KPlistAlertContacts]; for(int j=0;j<[arrChillListAlert count];j++) { NSMutableDictionary *dicContactCompare= [arrChillListAlert objectAtIndex:j]; if([[dicContactCompare valueForKey:KEmailId] isEqualToString:[dicContact valueForKey:KEmailId]] && [[dicContactCompare valueForKey:KPhoneNo] isEqualToString:[dicContact valueForKey:KPhoneNo]]) { [appDelegate.IndexPathRowArray addObject:[NSString stringWithFormat:@"%d", range.location]]; [appDelegate.IndexPathRowArray addObject:[NSString stringWithFormat:@"%d", [[sectionArray objectAtIndex:range.location] count]-1]]; } }

} } else {

[[sectionArray objectAtIndex:25] addObject:dicContact]; if(appDelegate.selectContactForAlert==TRUE) { NSMutableArray *arrAlerts=[appDelegate.dicPlistData valueForKey:KPlistAlerts]; NSMutableDictionary *dicAlertSelect=[arrAlerts objectAtIndex:appDelegate.alertGroupIndex]; NSMutableArray *arrChillListAlert=[dicAlertSelect valueForKey:KPlistAlertContacts]; for(int j=0;j<[arrChillListAlert count];j++) { NSMutableDictionary *dicContactCompare= [arrChillListAlert objectAtIndex:j]; if([[dicContactCompare valueForKey:KEmailId] isEqualToString:[dicContact valueForKey:KEmailId]] && [[dicContactCompare valueForKey:KPhoneNo] isEqualToString:[dicContact valueForKey:KPhoneNo]]) { [appDelegate.IndexPathRowArray addObject:[NSString stringWithFormat:@"%d", 25]]; [appDelegate.IndexPathRowArray addObject:[NSString stringWithFormat:@"%d", [[sectionArray objectAtIndex:25] count]-1]]; } } } } }

You might also like