abaddressbook

Customizing table cell in ABPeoplePickerNavigationController

穿精又带淫゛_ 提交于 2020-01-12 06:50:31
问题 I've spent some time searching for this answer on SO, but couldn't find it, so here goes: I'm starting with an ABPeoplePickerNavigationController, and when a user taps a person, they'll be taken to an ABPersonViewController where they'll be able to select phone numbers and email addresses. After they're finished with the ABPersonViewController, they'll be taken back to the ABPeoplePickerNavigationController. Pretty simple stuff. What I want is to add a detailLabel to the table cell they

ABAddressBookCreate deprecated

一笑奈何 提交于 2020-01-10 08:29:07
问题 I'm creating an application that will save a contact to the address book, but when I use ABAddressBookCreate to my code, it appear as a warning. I'm coding in iOS 7. My question is, what is the substitute for ABAddressBookCreate in iOS 7. Any help will be appreciated. Thanks. 回答1: Use ABAddressBookCreateWithOptions() instead. ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL, NULL); More info on usage in the documentation here edit The AddressBook framework is deprecated in

Access contact image from address book based on its id

倾然丶 夕夏残阳落幕 提交于 2020-01-06 22:00:04
问题 As every one is aware of the fact that we can create an address book(ABAddressBook),copy all people in array and then create a record reference(ABRecordRef),then copy its image data using NSData as follows: ABAddressBookRef addressBook = ABAddressBookCreate( ); CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople( addressBook ); ABRecordRef recordReference = CFArrayGetValueAtIndex(allPeople, addressIndex); NSData *imageData = (NSData *)ABPersonCopyImageData(recordReference); Now this

deleting a contact from address book using personViewController

无人久伴 提交于 2020-01-06 04:34:05
问题 I am getting hand over the address book and created it successfully without any option of 'deleting a contact' from address book. Is there any method to delete contact from address book. I got help from i OS reference library . I am using personViewController methods 回答1: Take a look at ABPersonViewController+Delete category which does not use any private methods: https://github.com/shrtlist/ABDelete 来源: https://stackoverflow.com/questions/5038840/deleting-a-contact-from-address-book-using

Why do the deprecated ABAddressBook APIs crash iOS 10?

一世执手 提交于 2020-01-05 05:34:05
问题 I suppose this is largely a question about how iOS handles deprecating APIs. I have an app that supports iOS 8.3+, and it worked fine through 9.3.x, but it breaks on iOS 10. When my app lets the user pick a contact, the error that I get is: Terminating app due to uncaught exception 'CNPropertyNotFetchedException', reason: 'A property was not requested when contact was fetched.' I found another post here which says that ABAddressBook APIs are deprecated and that I should use

ABPeoplePickerNavigationController customisation

女生的网名这么多〃 提交于 2020-01-03 00:27:53
问题 I want to use ABPeoplePickerNavigationController but I want to customise the view. I want to have an accessory image by some of the contacts, and I want to sort them in a different way than the default one. Is there a way to do it? Or do I have to create my own UITableViewController ? 回答1: You'll have to create your own table view if you want to customize the appearance of the contacts in this manner. For example, you can extract the contacts using: - (void)loadContacts {

how to sort iphone contact book?

落花浮王杯 提交于 2019-12-31 09:04:09
问题 How can i sort (or retrieve sorted array of ) an iphone contact book by first name & last name programmatically ?? Any help will be well appreciated...! Thanks 回答1: Call ABAddressBookCopyArrayOfAllPeople() to get an array of all person records in the address book. Then follow the documentation: To sort an array of people, use the function CFArraySortValues with the function ABPersonComparePeopleByName as the comparator and a context of the type ABPersonSortOrdering. The user’s desired sort

how to sort iphone contact book?

只谈情不闲聊 提交于 2019-12-31 09:04:04
问题 How can i sort (or retrieve sorted array of ) an iphone contact book by first name & last name programmatically ?? Any help will be well appreciated...! Thanks 回答1: Call ABAddressBookCopyArrayOfAllPeople() to get an array of all person records in the address book. Then follow the documentation: To sort an array of people, use the function CFArraySortValues with the function ABPersonComparePeopleByName as the comparator and a context of the type ABPersonSortOrdering. The user’s desired sort

How to open the Edit contact window in iphone app?

Deadly 提交于 2019-12-25 09:01:24
问题 I am adding contact info from my iPhone application on Addcontact click. I just want to open edit contact window on same Addcontact click so user can edit or delete the contact which just now have added. I have done smthing like below.. - (IBAction)AddContact { ABAddressBookRef addressBook = ABAddressBookCreate(); ABRecordRef Showroom = ABPersonCreate(); //adding contact name as showroom name ABRecordSetValue(Showroom, kABPersonFirstNameProperty, ShowroomName.text , nil);

How to get Custom label and value of the Email in ABAddressBook

我与影子孤独终老i 提交于 2019-12-25 06:18:05
问题 In AddressBook of iPad,when i am trying to add a email, I have an option to set my own Custom Label and give the email, Problem: I am not able to fetch that particular label and its value, I am able to get other,iCloud,home,work email IDs from Addressbook. This is the Code related to what i have done: //Email ABMultiValueRef emailID = ABRecordCopyValue(recordRef, kABPersonEmailProperty); CFIndex emailCount = ABMultiValueGetCount(emailID); // PSLog(@"counter %ld",emailCount); NSString