How to delete one number of iphone contact which has multiple numbers in the contact?

荒凉一梦 提交于 2019-12-22 10:19:50

问题


I want to delete contact of iphone manually(with number by number). Can anyone help me to do the same. I have done with deleting contact using method

ABAddressBookRemoveRecord(addressBook, record, nil);

This method makes me to delete a single contact with all of its record but I want to do delete manually means want to delete single number of the existing contact if it has multiple numbers. The given image says the requirement.


回答1:


You Can refer following links which will be helpful to you......

http://www.xprogress.com/post-56-best-example-of-how-to-add-entry-to-contacts-using-addressbookui-framework-on-iphone-sdk/

http://www.modelmetrics.com/tomgersic/iphone-programming-adding-a-contact-to-the-iphone-address-book/

iOS - add contact into Contacts?

With the help of these links you can know to add contact to iphone OS programatically...

To resolve this problem you have to get the existing contact object(ABRecordRef object) which you have to update ,get the number property label object which contains all the numbers,remove the number which u want to delete from the ABMutableMultiValueRef of the numbers which u have to prepare.Then after doing all the stuffs... use following code...

ABRecordSetValue(person, kABPersonPhoneProperty, multiPhone,nil);

Then save the addressbook using following code....

ABAddressBookSave(iPhoneAddressBook, &error);

This code is on the basis of my R&D, try this it must work....Thanks!!!




回答2:


In order to delete all contacts form iPhone, you have them syncing with another source (gmail, windows contacts, Yahoo, etc.) then in iTunes, select your iPhone under devices (left side), go to Info (top), deselect "Sync contacts with".

When you do this, it will ask you to remove your contacts or not. Click on "Remove Contacts", and then Apply (botton right).

If you don't have your contacts sync'd, then you can either setup a temporary sync to what service you have access to and then do the above, or do them one at a time.



来源:https://stackoverflow.com/questions/20652640/how-to-delete-one-number-of-iphone-contact-which-has-multiple-numbers-in-the-con

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!