addressbook

Getting merged/unified entries from ABAddressBook

烂漫一生 提交于 2019-11-29 21:48:21
I'm developing an application that is showing the iPhone contacts. The ABAddressBookRef returns duplicate entries for a contact that appears only once in the iPhone contacts application. Looking on the contact card (from the iPhone contacts), in the bottom there is a section called "Linked Contacts" so obviously apple "merge"/"unify" these two entries into the one i see. The question here is what is the best way to mimic the same behavior so my app will show only one entry? is there an API that returns the merged/unified entries from the address book? Min Tsai To create a list of contacts that

iphone addressbook - getting null item in ABAddressBookGetPersonWithRecordID

两盒软妹~` 提交于 2019-11-29 19:06:24
问题 I'm really struggling with ABAddressBookGetPersonWithRecordID at the moment. I am saving an ID, and then trying to call it back up again. Currently im doing something simple to test the linking, but its not working. First, I can read objects from my iphone simulator address book using: -(BOOL)peoplePickerNavigationController: (ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person { NSString *contactName; NSString *contactCompany; NSString

how can I Add a ABRecordRef to a NSMutableArray in iPhone?

一曲冷凌霜 提交于 2019-11-29 18:21:15
问题 I want to create an array of ABRecordRef(s) to store contacts which have a valid birthday field. NSMutableArray* bContacts = [[NSMutableArray alloc] init]; ABAddressBookRef addressBook = ABAddressBookCreate(); CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople(addressBook); CFIndex nPeople = ABAddressBookGetPersonCount(addressBook); for( int i = 0 ; i < nPeople ; i++ ) { ABRecordRef ref = CFArrayGetValueAtIndex(allPeople, i ); NSDate* birthdayDate = (NSDate*) ABRecordCopyValue(ref,

Address Book constants evaluating as zero

时光毁灭记忆、已成空白 提交于 2019-11-29 14:51:00
I have a program where for certain code paths, the address book constants (such as kABPersonEmailProperty, kABPersonAddressProperty) evaluate to their normal non-zero value. However, if I follow a different code path, all these constants evaluate to zero. Furthermore, once I follow the "successful" code path, if I take the problematic code path it works. Is this some kind of compile linkage issue ? I could also be over-releasing a variable somewhere. Okay, mystery solved. To Apple's credit, the behavior is documented. See link text "Special Considerations: The value of these constants is

Sort NSArray of NSStrings like Addressbook on iphone sort

…衆ロ難τιáo~ 提交于 2019-11-29 13:41:48
问题 I have an array of strings (names) and i would like to sort them like how the address book on the iphone sorts them eg: éli -> under E eg: àli -> under A eg: 4li -> under # any suggestions? 回答1: You need to perform a diacritic insensitive comparison against the strings. NSString has a compare:options: method with an option of NSDiacriticInsensitiveSearch . NSArray *array = [NSArray arrayWithObjects:@"éli", @"bob", @"earl", @"allen", @"àli", @"aaron", nil]; NSArray *sorted = [array

localising postal / physical address display from database fields

十年热恋 提交于 2019-11-29 07:24:19
问题 Can anyone point me to a list of international postal / residential / delivery address format templates that use some kind of parseable standard vocabulary for address parts? The ideal list contains a country code then a format using replaceable tokens so I can substitute database address fields into a template to produce something printable in the local format. for example NZ | [first_name] [family_name]\n[company_name]\n[street_address]\n[city] [post_code]\n[country] AU | [first_name]

iPhone multi-threaded AddressBook manipulation

风流意气都作罢 提交于 2019-11-29 06:42:21
I have been using the AddressBook api of the iPhone for some time now. But doing some refactoring to improve application performance I have decided to "reuse" the ABAddressBookRef returned by AddressBookCreate because I noticed there are large performance improvements doing that. However, I am getting EXEC_BAD_ACCESS errors now randomly, and I think the reason is in this "caveat" in the iPhone reference implementation: http://developer.apple.com/iphone/library/documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/300-BasicObjects/BasicObjects.html#//apple_ref/doc/uid

Setting Address Book image for a contact doesn't seem to work

蹲街弑〆低调 提交于 2019-11-29 02:39:54
I'm trying to set the contact image with the code below. I am not seeing any errors, and the image is not saved to the contact entry in the address book. Please help! I must be doing something wrong... - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person { [abcontroller setDisplayedPerson:person]; UIImage *im = [UIImage imageNamed:@"image1.jpg"]; NSData *dataRef = UIImagePNGRepresentation(im); CFErrorRef error; ABAddressBookRef addressBook = ABAddressBookCreate(); NSLog(@"Error:",error); if

How to add a contact from my app to the iOS address book

☆樱花仙子☆ 提交于 2019-11-29 00:12:48
I would like to add the ability to save a contact (phone number, name, address and email) in the iOS address book by clicking on a button in my application! How can I do this? Its so easy and follows below steps, First, you have import following frameworks, #import <AddressBook/AddressBook.h> #import <AddressBookUI/AddressBookUI.h Second, write the following code in your button action and modify the code according to your needs, NSString * addressString1 = [appDelegate getCurrentSummary]; NSString * addressString2 = [appDelegate getCurrentTubeImage]; NSString * cityName = [appDelegate

AddressBook synchronization in iOS

偶尔善良 提交于 2019-11-28 21:09:20
问题 Is there any way in iOS to get notification about address book changes since the last time applications was opened. The application stores address book in internal database and I don't want to perform full sync each time it activated. Thanks in advance. Small addition to clarify the question: I use ABAddressBookRegisterExternalChangeCallback to observe changes when application suspended to background, but from what I know, this method can't work if application was closed completely and