[英]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.