阅读背景:

尝试使用NSUbiquitousKeyValueStore使用iCloud做一些非常简单的事情

来源:互联网 

So I am simply trying to get my Ubiquious key data thing working. And unfortunately I have not been able too! I just cant get it to do anything with iCloud!

所以我只是想让我的Ubiquious关键数据工作起来。不幸的是我也没能做到!我不能让它与iCloud做任何事情!

Here is a project file that has a simple storyboard with three buttons. The goal would be that you press the "upload button", wait a bit, delete the app, reinstall, press check, and the console prints out "IT WORKED". However it seems to always print out "nil" indicating that iCloud isn't working!

这是一个项目文件,它有一个带有三个按钮的简单故事板。目标是按下“上传按钮”,稍等一下,删除应用程序,重新安装,按下检查,然后控制台打印出“IT WORKED”。但是它似乎总是打印出“nil”表示iCloud无法正常工作!

The project contains basically no code. It will only take you a second or two to read all of it.

该项目基本上没有代码。阅读全部内容只需要一两秒钟。

You might have to change the bundle identifier and make a provisioning profile that accepts iCloud. Also make sure to activate iCloud in your "capabilities" section.

您可能必须更改捆绑包标识符并创建一个接受iCloud的配置文件。还要确保在“功能”部分激活iCloud。

If you can manage to get this working or tell me what I am doing wrong it would be MUCH appreciated! Here are some tutorials I used on this.

如果你能设法让这个工作或告诉我我做错了什么,那将是非常感谢!以下是我在此使用的一些教程。

1 个解决方案

#1


0  

OK! So after i realized that the apple example worked I had a crazy thought. I copied "$(TeamIdentifierPrefix)com.broccoli.sharedkvstore" from their entitlements file and put it into my projects entitlements file (technically i switched "yourcompanyname" with "broccoli"). And it worked!

好!因此,在我意识到苹果的例子有效之后,我有一个疯狂的想法。我从他们的权利文件中复制了“$(TeamIdentifierPrefix)com.broccoli.sharedkvstore”并将其放入我的项目权利文件中(技术上我将“yourcompanyname”改为“broccoli”)。它奏效了!

A big thank you to @beowulf, and @mundi without whom I couldn't have fixed this.

非常感谢@beowulf和@mundi,没有他我无法解决这个问题。


分享到: