storing adressbook contacts into a nsdictionary
i'm still trying to wrap my head around using NSDictionaries, and have come into a situation where i believe i need to use one. essentially, i would like to store all the phone numbers associated with each contact into a dictionary. so far i have this:

	

    ABAddressBookRef addressBook = ABAddressBookCreate();
    NSArray *thePeople = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook);	
    for (id person in thePeople)
    {
    	ABMultiValueRef phones =(NSString*)ABRecordCopyValue(person, kABPersonPhoneProperty);
        NSString* name = (NSString *)ABRecordCopyCompositeName(person); 
    	for (CFIndex i = 0; i < ABMultiValueGetCount(phones); i++)
    	{
    		NSString *phone = [(NSString *)ABMultiValueCopyValueAtIndex(phones,i) autorelease];
    	}
    }

i was wondering how to use a nsdictionary to store each person, and then an array of each phone value that's associated with that person. 

thanks.
 

storing adressbook contacts into a nsdictionary
===

i'm still trying to wrap my head around using NSDictionaries, and have come into a situation where i believe i need to use one. essentially, i would like to store all the phone numbers associated with each contact into a dictionary. so far i have this:

	

    ABAddressBookRef addressBook = ABAddressBookCreate();
    NSArray *thePeople = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook);	
    for (id person in thePeople)
    {
    	ABMultiValueRef phones =(NSString*)ABRecordCopyValue(person, kABPersonPhoneProperty);
        NSString* name = (NSString *)ABRecordCopyCompositeName(person); 
    	for (CFIndex i = 0; i < ABMultiValueGetCount(phones); i++)
    	{
    		NSString *phone = [(NSString *)ABMultiValueCopyValueAtIndex(phones,i) autorelease];
    	}
    }

i was wondering how to use a nsdictionary to store each person, and then an array of each phone value that's associated with that person. 

thanks.
 
