Test NSUserDeletedZone in CloudKit While In Development

半城伤御伤魂 提交于 2019-12-11 11:57:12

问题


Thanks for taking a look. I'm hoping someone can help, I am a bit at my wits end here.

I have an application in production that currently does not handle CloudKit's CKErrorUserDeletedZone error. This happens when a user deletes the container data from the Settings->iCloud area on their iPhone/iPad, or System Preferences->iCloud area on their Mac.

The problem I am having is I am not able to test this scenario while running from Xcode since it uses the Development not Production servers. Only production databases show up in the Settings/System Preferences areas. This means I cannot recreate the scenario while able to debug in Xcode. The only way to test in production is to export the application and sadly there's no way to debug from Xcode when that's done.

Is there any way to potentially test this or am I flying completely blind here? I'd happily just deal with it in production but with a very large number of users I'd rather not make a mess of things when only a few users are encountering issues at the moment.

Thanks!


回答1:


You can configure your debug build to use the production container by adding the following entry to your .entitlements file:

<key>com.apple.developer.icloud-container-environment</key>
<string>Production</string>

Xcode does the same thing when preparing your app for submission.




回答2:


You can now test this by ticking purge zone in the dashboard.



来源:https://stackoverflow.com/questions/32384811/test-nsuserdeletedzone-in-cloudkit-while-in-development

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