Trying to get data from the AB
Trying to get data from the AB
- Subject: Trying to get data from the AB
- From: Development <email@hidden>
- Date: Tue, 6 Apr 2010 11:48:25 -0700
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 (email@hidden)
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:
This email sent to email@hidden