I am using the following: 
        
        [settings setObject:(NSString *)ABRecordCopyValue(person, 
kABPersonFirstNameProperty) forKey:@"First Name"];
        [settings setObject:(NSString *)ABRecordCopyValue(person, 
kABPersonLastNameProperty) forKey:@"Last Name"];
        //
        ABMutableMultiValueRef multiValue = ABRecordCopyValue(person, 
kABPersonAddressProperty);

        **Crashes here*** CFDictionaryRef dict = 
ABMultiValueCopyValueAtIndex(multiValue, 0);

        CFStringRef street = CFDictionaryGetValue(dict, 
kABPersonAddressStreetKey);
        CFStringRef abcity = CFDictionaryGetValue(dict, 
kABPersonAddressCityKey);
        CFStringRef abstate = CFDictionaryGetValue(dict, 
kABPersonAddressStateKey);
        CFStringRef abzip = CFDictionaryGetValue(dict, kABPersonAddressZIPKey);
        NSLog(@"%@",(NSDictionary*)dict);
        CFRelease(dict);
        [settings setObject:(NSString *)street forKey:@"City"];
        [settings setObject:(NSString *)abstate forKey:@"State"];
        [settings setObject:(NSString *)abzip forKey:@"Zip"];
        [settings setObject:(NSString *)street forKey:@"Address"];
        //
        [settings setObject:(NSString *)ABRecordCopyValue(person, 
kABPersonPhoneMainLabel) forKey:@"Phone"];
        [settings setObject:(NSString *)ABRecordCopyValue(person, 
kABPersonPhoneWorkFAXLabel) forKey:@"Fax"];
        [settings setObject:(NSString *)ABRecordCopyValue(person, 
kABPersonURLProperty) forKey:@"URL"];
        [settings setObject:(NSString *)ABRecordCopyValue(person, 
kABPersonEmailProperty) forKey:@"Email"];
        [settings setObject:(NSString *)ABRecordCopyValue(person, 
kABPersonOrganizationProperty) forKey:@"Business"];

To get information from the address book and insert it in to the preferences. 
But the Application is crashing when I attempt to copy the data to the 
CFDictionary.

Are there any examples of doing this I could look 
at?_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to