addressbook

Getting group for particular contact from AddressBook iPhone

試著忘記壹切 提交于 2019-12-07 02:44:41
I am getting group name for particular contact in my addressbook, but below code returns me wrong group name for example if contact C1 is from group G1 then code gives me group G2. Can anyone tell me what am I doing wrong here? *Code ABAddressBookRef addressBook = ABAddressBookCreate(); CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople(addressBook); CFIndex nPeople = ABAddressBookGetPersonCount(addressBook); NSInteger recordId; ABRecordRef recordGroupID; for( int i=0;i< nPeople;i++) { NSMutableDictionary *dict = [[NSMutableDictionary alloc] init]; @try { NSAutoreleasePool *Pool = [

Addressbook Save Image for contacts programmatically

心已入冬 提交于 2019-12-06 15:45:12
I am creating an addressbook application in that all the data are stored to server and when User will ask then server will restore all the contacts to iPhone. My problem is how to send Image to server as well as how I will be able to restore the contact Image , I came to know that my server will provide me an Image in base64 encryption format. So can any help me how to perform image saving and retrieving for Addressbook Programmatically You need to convert the base64 image in nsdata and then you can set it to a contact, check "ABPersonSetImageData" in following code. ABRecordSetValue(newPerson

Add phone number to existing contact

倖福魔咒の 提交于 2019-12-06 11:48:14
问题 I am trying to add a phone number to an existing contact using the AddressBook framework, after selecting a person with the picker this method is called: - (BOOL) peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person { if(_phoneNumber != nil) { ABMutableMultiValueRef multiPhone = ABMultiValueCreateMutableCopy (ABRecordCopyValue(person, kABPersonPhoneProperty)); ABMultiValueAddValueAndLabel(multiPhone, (_

Get Email address from iPhone Address Book

跟風遠走 提交于 2019-12-06 11:39:35
问题 I am currently able to successfully access and get data from the peoplePickerNavigationController , but what I would like to do is have the email address of the contact be accessed, then the modal window dismissed when the contact name is pressed. Scenario: "Button is clicked to add a contact AddressBook Modal Window slides into view Name of Contact is pressed If available, the contact's email address is stored in an array Dismiss modal window" My current code consists of: - (BOOL

How can I add custom fields to contacts info in iphone contact list

橙三吉。 提交于 2019-12-06 08:41:23
问题 I am developing a app in which I have to add custom contacts to iPhone Contact list. To elaborate that every contact in iPhone have a definite set of fields which we can be used to save contact info. I want to know if we can add custom fields apart from that ofexisting options in iPhone. If its possible please show me the way to do that, googled it but didn't found any thing meaningfull. Thanks in advance. 回答1: From this. ABRecordRef aRecord = ABPersonCreate(); CFErrorRef anError = NULL;

Trie based addressbook and efficient search by name and contact number

拈花ヽ惹草 提交于 2019-12-06 06:48:35
问题 it is a known approach to develop an addressbook based on trie datastructure. It is an efficient data structure for strings. Suppose if we want to create an efficient search mechanism for an address book based on names, numbers etc, what is the efficient data structure to enable memory efficient and faster search based on any type of search terms irrespective of data type? 回答1: This is a strange question maybe you should add more informations but you can use a trie data structure not only for

iPhone: How do you get the names of all the address books on the iPhone?

丶灬走出姿态 提交于 2019-12-06 06:35:48
问题 Some users have multiple address books in their iPhone Contacts, as a result of different synchronization connections they have made with e.g. Exchange Servers. How is it possible to get all of these different address books? I would be interested in getting the names under which these different address books are saved and accessing their contact information. Thank you! 回答1: ABAddressBookRef addressBook = ABAddressBookCreate(); CFArrayRef sourcesArray = ABAddressBookCopyArrayOfAllSources

deselectRowAtIndexPath on an ABPeoplePickerNavigationController

泄露秘密 提交于 2019-12-06 03:43:00
问题 I'm showing an ABPeoplePickerNavigationController as a tab in my app. The user clicks a name, then email address, then I do something with the email address. Afterwards, I'd like for the person and property that they selected to fade out (not be highlighted). In a normal table, I'd call deselectRowAtIndexPath. But with the ABPeoplePickerNavCont I don't seem to have access to it's table, nor do I know what indexPath is selected, nor is there an api for deselecting the row. On most apps,

AddressBook: Differentiating sources of type kABSourceTypeExchangeGAL

℡╲_俬逩灬. 提交于 2019-12-06 00:53:45
The question I'm asking have already been asked a number of times on this site (links to the previous threads are below my question). When working with iOS AddressBook, and trying to get Exchange GAL address book, the type name returns Nil. The code that I use (and suggested in all previous threads) is: CFStringRef sourceName = (CFStringRef)ABRecordCopyValue(source, kABSourceNameProperty); This basically means that if there are more than one Exchange address book mapped on the device (and there is no limitation to do so...), then there is no way to know which one is the one you need. The

Address Book crash on iOS10

倾然丶 夕夏残阳落幕 提交于 2019-12-06 00:10:38
Selecting a contact from contact picker crashes the app in iOS10.0. Contacts picker is shown using ABPeoplePickerNavigationController like this: let contactsPicker = ABPeoplePickerNavigationController() contactsPicker.peoplePickerDelegate = self self.presentViewController(contactsPicker, animated: true, completion: nil) Here is the stack trace from crash log: *** Terminating app due to uncaught exception 'CNPropertyNotFetchedException', reason: 'A property was not requested when contact was fetched.' *** First throw call stack: ( 0 CoreFoundation 0x0000000105a1c34b __exceptionPreprocess + 171