NSUbiquitousKeyValueStore failing on macOS Sierra

When I call NSUbiquitousKeyValueStore's synchronize method after running my app directly from Xcode on macOS Sierra, it returns false and following error is printed in Console.app:


Refusing TCCAccessRequest for service kTCCServiceUbiquity from client com.apple.dt.Xcode in background session


As far as I can tell, changed keys are not saved to iCloud. They are remembered in memory locally but lost after app re-launch.


I believe all my entitlements are set correctly (iCloud KVS enabled in Capabalities of the project, all checked). Do I need to archive & export my app in order to debug / test iCloud?


Any ideas how to fix / workaround this?

Replies

same problem here, as Sierra has a GM versio now it would be time to fix this serious issue, it will break KV storage based applications.

i've sent several related bug reports, no results yet :/