简体   繁体   English

如何在应用程序处于后台时通过iCloud检查我的UIDocument是否已更新?

[英]How can I check if my UIDocument has been updated via iCloud while the app was in the background?

I noticed that UIDocument's methods to let the app know of a change, such as presentedItemDidChange , only get called if the app is running in the foreground. 我注意到,UIDocument的方法,让变化,如应用程序知道presentedItemDidChange ,只得到如果应用程序在前台运行调用。

What I'm wondering is, if the user was to switch apps or send my app to the background, how can I know if the UIDocument has changed since the user last saw it when they bring the app to the foreground again? 我想知道的是,如果用户要切换应用程序或将我的应用程序发送到后台,我怎么知道UIDocument自用户上次再次看到它后再次将应用程序带到前台时是否已更改?

Or, should I be updating everything every time the app returns to the foreground just in case the UIDocument has been updated? 或者,每当应用程序返回到前台时,我是否应该更新所有内容,以防万一UIDocument已更新?

uidocument自己处理所有更改通知,因此如果文档在其他设备中更改,将自动调用loadFromContents:ofType:error:以反映这些更改,因此您唯一需要做的就是实现此方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用iCloud在我的应用程序之间同步UIdocument文件(保存在本地文档目录中)? - How can I use iCloud to synchronize a UIdocument files (saved in local document directory) between my apps? iOS:如何在iCloud中合并冲突的UIDocument? - iOS: How can I merge conflicted UIDocument's in iCloud? 我如何知道该应用在后台被杀死后是否已从本地通知中打开? - How can I know if the app has been opened from a local notification after it has been killed in the background? 如何在iOS中应用程序处于后台时检查连接是否已切换到3G? - How to check if connection has been switched to 3G while app is in background in iOS? 如何按修改日期对UIDocument的icloud NSMetadataQuery结果进行排序? - How can I sort an icloud NSMetadataQuery result of UIDocument's by modification date? 我可以知道 iOS 应用程序是否已更新吗? - Can I find out if the iOS app has been updated? 我如何查看我的应用程序是否有iCloud数据? - How can i see if my app got iCloud data? 如何检查应用程序是否已更新? - How check that the application has been updated? 如何确认已为我的应用程序启用了iCloud备份? - How can I confirm that iCloud Backup is enabled for my app? 当我的应用程序处于后台时,如何与云同步项目? - How can I synchronize items with the cloud while my app is in the background?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM