Objective-C Adding Contact to Favorites [closed]

懵懂的女人 提交于 2019-12-13 09:42:48

问题


I know a new contact can be created in an iOS addressbook.

Is there a way to also flag that contact and set it as a 'Favorite' programmatically?


回答1:


I am not aware of any public API for this. And it makes sense, since this is a very invasive action. You should not be doing this - the user should be doing it.




回答2:


Favorite contacts vary from one app to the next -- it's not something that the AddressBook framekwork manages. Take a look at the Phone app, and then look at FaceTime; you'll see that the contacts in the favorite lists are different (unless you've set the same favorites in both apps, of course). The same is true of the "recent" category.

To implement a Favorites list in your own app, keep track of the record identifiers for the contacts that the user chooses as favorites in your app. You can use ABPeoplePickerNavigationController to easily let users choose contacts to add to your favorites list.



来源:https://stackoverflow.com/questions/20621390/objective-c-adding-contact-to-favorites

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