在我的应用中,当我尝试在iOS模拟器中运行代码时:
NSURL *iCloudURL = [fileManager URLForUbiquityContainerIdentifier:@"2VHM28566N.com.eept.TestICloud"];
NSLog(@"IS ICloud : %@", [iCloudURL absoluteString]);
这表明iCloudURL为空。
我们能在没有iPhone设备的情况下使用iCloud吗?
在我的应用中,当我尝试在iOS模拟器中运行代码时:
NSURL *iCloudURL = [fileManager URLForUbiquityContainerIdentifier:@"2VHM28566N.com.eept.TestICloud"];
NSLog(@"IS ICloud : %@", [iCloudURL absoluteString]);
这表明iCloudURL为空。
我们能在没有iPhone设备的情况下使用iCloud吗?
我今天在模拟器上尝试运行我的iCloud应用程序,但是据我所知,在模拟器中没有启用iCloud的选项。我查看了设置,但没有找到。因此答案是否定的,除非您在实际设备上测试,否则无法真正测试iCloud。
如果有人有解决办法,那就太棒了。总是在设备上测试您的应用程序有点繁琐。
在Xcode 5中:
iOS模拟器现在支持应用内文档和KVS数据的iCloud同步,使得应用能够通过iCloud在多个设备之间同步。这个功能在测试时非常有用,以确保应用文档和数据可在多个设备上正确同步。
注意:在iOS模拟器中运行应用程序时,请使用“设置”应用程序登录Apple ID账户。登录后,在Debug菜单中使用“触发iCloud同步”命令来告诉模拟器与其他设备同步。
2VHM28566N.com.eept.TestICloud
2VHM28566N - Being the TeamID which Apple assign you when you register as a developer
com.eept - Reverse domain notation of the App's related website i.e. Apple apps would have com.apple
TestICloud - The name of that app itself.
teamid.com.yourdomain.appname