abaddressbook

iOS - How to search a “searchable” ABSource, with ABSourceType | kABSourceTypeSearchableMask

自作多情 提交于 2019-12-03 05:50:30
Has anyone ever succeeded in searching for names in an Exchange GAL linked to an iOS device, using ABAddressBook framework, or otherwise? I've managed to get all the names from the contacts stored on the device - that bit's easy - but it doesn't include names from the Exchange GAL. I've also managed to get the ABSource for the GAL. It's type is: kABSourceTypeExchangeGAL = kABSourceTypeExchange | kABSourceTypeSearchableMask This suggests the source is searchable, given that the kABSourceTypeSearchableMask bit is set ( kABSourceTypeSearchableMask = 0x01000000 ), but how to search it is anyone's

Correct vCard format for iOS devices?

旧巷老猫 提交于 2019-12-03 03:35:21
In iOS 5 and above, Apple introduced the ABPersonCreatePeopleInSourceWithVCardRepresentation method, which is pretty useful in feeding a vCard to the Address Book and getting back the ABRecordRefs for the persons created. However, the Apple vCard seems to be (at least a bit) different from a standard vCard, as I have found out while trying to add standard vCards to the Address Book. Is there a page somewhere detailing what the Apple-format for a vCard should be? Thanks! The ABPersonCreatePeopleInSourceWithVCardRepresentation docs state that vCard version 3 is the supported protocol .

How to select a contact with ABPeoplePickerNavigationController in Swift?

时光毁灭记忆、已成空白 提交于 2019-12-03 01:45:40
I have added the ABPeoplePickerNavigationController into my first view controller. I want that when I select a contact show the info to show in other view controller, but I'm trying use my code and this not show never when I click in a contact. This only open the contact into native app ABPeoplePickerNavigationController . var people = ABPeoplePickerNavigationController() var addressBook: ABAddressBookRef? func extractABAddressBookRef(abRef: Unmanaged<ABAddressBookRef>!) -> ABAddressBookRef? { if let ab = abRef { self.view.addSubview(people.view) return Unmanaged<NSObject>.fromOpaque(ab

Find out memory leak?

自作多情 提交于 2019-12-02 23:20:46
问题 i am new on iphone apps.Now this is my first app,app is installed but not run? I write this code it shows memory leak.please find out.Thanks in advance. ABRecordRef ref = CFArrayGetValueAtIndex(all, i); CFStringRef *firstName = (CFStringRef *)ABRecordCopyValue(ref, kABPersonFirstNameProperty); NSLog(@"Name %@", firstName); contact.strFirstName = (NSString*)firstName; CFStringRef *lastName = (CFStringRef *)ABRecordCopyValue(ref, kABPersonLastNameProperty); NSLog(@"Name %@", lastName); contact

Load all the Contacts from iphone PhoneBook in a variable

本秂侑毒 提交于 2019-12-02 21:39:10
问题 I am naive to the xcode programming. I need to load all the contacts from the iPhone PhoneBook on a variable. Could you please suggest me some library or something like that. Any sample code would be highly appreciable. Looking forward to a response.:) Thanks in advance!!..... :) 回答1: Hey all after a long fight I found the following code working self.dataSource = [[NSMutableArray alloc]init]; // dataSouce is delared in .h file ABAddressBookRef addressBook = ABAddressBookCreate();

How to write Facebook/Twitter to address book in iOS?

时间秒杀一切 提交于 2019-12-02 19:04:43
问题 In my app I export some data to the address book in order to create some new contact entries. I can export everything I want to without problem, except Facebook and Twitter addresses. I'm completely lost on these two. Here's some code I'm using to export non-Facebook/Twitter data that DOES work: ABMutableMultiValueRef multiPhone = ABMultiValueCreateMutable(kABMultiStringPropertyType); ABMultiValueAddValueAndLabel(multiPhone, (__bridge CFTypeRef)(thePhoneMobile), kABPersonPhoneMobileLabel,

how to sort iphone contact book?

风格不统一 提交于 2019-12-02 18:24:18
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 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 order, as returned by ABPersonGetSortOrdering, is generally the preferred context. The following code listing

Custom actions on ABPersonViewController

旧巷老猫 提交于 2019-12-02 17:21:42
问题 My app brings up a ABPersonViewController and gives the user the option to edit, or to select the contact. I can easily allow editing ( pvc.allowsEditing = YES ) but I can't figure out how to add the Select button. I would prefer to add it to the ABPersonViewController as a custom button like the Text Message, etc. default buttons. 回答1: I ended up subclassing ABPersonViewController and sliding in a UIToolbar after it appears. An example is below: - (void)showToolbar { // build the toolbar

Intermittent error accessing core data model / contacts database

旧城冷巷雨未停 提交于 2019-12-02 12:17:52
I am getting an error in my iOS app. Frustratingly, it is an intermittent error - The task I am performing works 5 or 6 times in a row then crashes unexpectedly. The error log suggests an error opening a sqlite database - presumably the core data model in my app. However Xcode shows that the line in which the error occurs is accessing the Apple contacts database. So I am not clear what has happened. The error log is below. Can anyone interpret the output below and shed any light on this? warning: Could not compile statement PRAGMA journal_mode = wal;: unable to open database file error 14

Custom actions on ABPersonViewController

微笑、不失礼 提交于 2019-12-02 08:59:29
My app brings up a ABPersonViewController and gives the user the option to edit, or to select the contact. I can easily allow editing ( pvc.allowsEditing = YES ) but I can't figure out how to add the Select button. I would prefer to add it to the ABPersonViewController as a custom button like the Text Message, etc. default buttons. I ended up subclassing ABPersonViewController and sliding in a UIToolbar after it appears. An example is below: - (void)showToolbar { // build the toolbar items UIBarButtonItem *spaceItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem