开发者

Getting notifications on changes to the iPhone Address book

开发者 https://www.devze.com 2023-01-17 18:15 出处:网络
In my iPhone app, I have a collection of contacts from the iPhone address book, whose ABRecordIDs are stored via Core Data. I want to 开发者_开发技巧keep track of any changes made to them in and out o

In my iPhone app, I have a collection of contacts from the iPhone address book, whose ABRecordIDs are stored via Core Data. I want to 开发者_开发技巧keep track of any changes made to them in and out of my app. Currently, on startup, I loop through all the ABRecordIDs I have, checking for any updates. This is horribly inefficient, of course.

Is there a better way to do this? I'm looking at ABAddressBookRegisterExternalChangeCallback, but I'm wondering if this will report changes made outside of my app. For example, if I exit the app, edit one or more contacts in the addressbook, and then reopen the app, will I get a notification of the changes?

Any help would be very much appreciated! Thanks in advance!


My immediate suspicion is that you will, provided your app is backgrounded. If it exits (or gets killed), then of course you won't get the callbacks.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号