addressbook

ABAddressBook get birthday property

僤鯓⒐⒋嵵緔 提交于 2020-01-06 04:30:10
问题 I'm trying to get the birthday property from ABAddressBook on my iphone. I've looked through some discussions over the web and mostly recommends the same answer, which I have tried myself as below. But this still doesn't work for me so I wonder if i missed something else.... dayFormatter = [[[NSDateFormatter alloc] init]autorelease]; [self.dayFormatter setDateFormat:@"MMMM d"]; NSString* today = [dayFormatter stringFromDate:[NSDate date]]; NSLog(@"today:%@", today); NSLog(@"date:%@", [NSDate

Address Book callback not called

回眸只為那壹抹淺笑 提交于 2020-01-05 03:08:48
问题 I have an iPhone app that makes use of the AddressBook.framework and uses Core Data to store these contacts. In order to make sure I update my own database when the Address Book is updated (whether via MobileMe or editing within my own app), I am subscribing to the notification as to when the Address Book is updating. I call this on startup: ABAddressBookRef book = ABAddressBookCreate(); ABAddressBookRegisterExternalChangeCallback(book, addressBookChanged, self); Which (supposedly) calls this

ABSource name returning nil

二次信任 提交于 2020-01-03 05:33:10
问题 How do I get the name of an ABSource object? Using the following code, the name returns nil. ABAddressBookRef addressBook = ABAddressBookCreate(); for (id object in [(NSArray *)ABAddressBookCopyArrayOfAllSources(addressBook) autorelease]) { ABRecordRef source = (ABRecordRef)object; NSString *sourceTypeName = (NSString *)((CFStringRef)ABRecordCopyValue(source, kABSourceNameProperty)); NSLog(@"name: %@", sourceTypeName); } CFRelease(addressBook); 回答1: Here, you have an example of code to

AddressBook Crash, only with some contacts

别等时光非礼了梦想. 提交于 2020-01-02 03:28:05
问题 My app crashes, it is a problem that arises from the AddressBook API, it only happens with some contacts. Here is the log: Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x00000102, 0x316ebd38 Crashed Thread: 0 Thread 0 Crashed: 0 CoreFoundation 0x00001cfe CFRetain + 90 1 AddressBook 0x00004b2c ABCMultiValueCopyValueAtIndex + 28 2 AddressBook 0x0001066a ABMultiValueCopyValueAtIndex + 2 3 Call Monitor 0x00003824 -[CallAppDelegate peoplePickerNavigationController

Accessing native iPhone addressbook database and performing add and delete contacts?

余生长醉 提交于 2020-01-01 19:55:10
问题 In my application I need to implement the address book which should contains the native addressbook details, and the user should be able to add and delete from the address book and it should be updated in the native iphone addressbook. I read somewhere that the iphone native address book database is accesible. In documentation also I saw that addContact and Delete API's are exposed to addressbook. Can anyone please tell me how can I access the native AddressBook of the iphone, and.. how to

iOS can't get person's image

狂风中的少年 提交于 2020-01-01 12:27:29
问题 I have two tableViewControllers. The first one has a list of contacts. The another one shows detailed person's information. A chunk of code of first tableViewController ABAddressBookRef addressBook = ABAddressBookCreate(); ABRecordRef source = ABAddressBookCopyDefaultSource(addressBook); NSArray *allPeople = (__bridge_transfer NSArray*)ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering(addressBook, source,kABPersonSortByFirstName); for ( int i = 0; i < [allPeople count]; i++ ) { ...

How to simply retrieve list of Contacts in iOS7?

﹥>﹥吖頭↗ 提交于 2020-01-01 06:56:35
问题 I need to retrieve list of Contacts in iOS . Here is my code that is not work. NSMutableArray *myContacts = [[NSMutableArray alloc]init]; CFErrorRef error = NULL; ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL, NULL); if (addressBook!=nil) { NSArray *allContacts = (__bridge_transfer NSArray*)ABAddressBookCopyArrayOfAllPeople(addressBook); NSUInteger i = 0; for (i = 0; i<[allContacts count]; i++) { Person *person = [[Person alloc] init]; ABRecordRef contactPerson = (_

ABRecordID for a record in addressbook(unique id for inserted record in addressbook)

只愿长相守 提交于 2020-01-01 03:45:07
问题 I got stuck while adding records to contacts of iphone. Situation is this I have a view in which contacts are created and inserted to contacts of iphone. What I want is Is there a way to find some unique ID of the (record) contact which is inserted. Which will be required to access the contacts in some other view. Please enlighten me on this. 回答1: When you insert a new record in the AddressBook, the record is automatically assigned an ABRecordID that you can retrieve using ABRecordID

iPhone Address Book: How to get a list of only contacts with phone numbers?

送分小仙女□ 提交于 2020-01-01 03:31:09
问题 I'd like to get a list of all ABContacts that have a phone number and only those contacts. Any contacts with just an email I do not want to show. Android has a field called HAS_PHNONE_NUMBER you can query on but I'm not seeing anything like that for iPhone. For example: ABAddressBookRef addressBook = ABAddressBookCreate(); CFArrayRef people = ABAddressBookCopyArrayOfAllPeople(addressBook); //How do I filter people into an array of contacts that all have a phone number? 回答1: You can use this

Add a contact to the mobile device Address book from an HTML webpage

删除回忆录丶 提交于 2019-12-30 17:32:09
问题 I'm currently building a site where, with one touch, you should be able to add a contact to your IPhone/Android Address book. The website is currently HTML5, but Javascript and/or PhP options could be implemented. So is there a way that on the click of a link, the mobile device will open the Adress book already filled with the info I want it to have (Name, EMail Address, Street Address, Phone number). I've looked everywhere to only find ways to program apps that would do the same thing. I