简体   繁体   English

我可以在没有coredata的情况下使用icloud数据吗?

[英]Can i use icloud data without coredata?

I'm new in icloud.I'm searching about how to do this in the rigth way. 我是icloud的新手,我正在搜索如何以严格的方式执行此操作。 But my questions is Do I have to implement core data to store documents on icluod? 但是我的问题是我是否必须实现核心数据才能将文档存储在icluod上? how can I do it? 我该怎么做? Does anyone have a good tutorial about icloud? 有人有关于icloud的好教程吗?

I have this code 我有这个代码

-(NSString *)archivePathWithName:(NSString*) name {
NSArray *documentDirectories = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

NSString *documentDirectory = [documentDirectories objectAtIndex:0];

return [documentDirectory stringByAppendingPathComponent:name];

}

then i save it like that 然后我像这样保存

[NSKeyedArchiver archiveRootObject:items toFile:[self archivePathWithName:name]];

is that being saved at iCloud? 是保存在iCloud上吗?

No, you don't have to use Core Data. 不,您不必使用核心数据。

  • You can use the key value store of an iCloud OR 您可以使用iCloud的键值存储
  • You can just save your files in your app's iCloud document folder and they'll be synchronized automatically 您只需将文件保存在应用程序的iCloud文档文件夹中,它们就会自动同步

Core Data iCloud support only gives you incremental updating of a database across devices - which is very nice if you need it... Almost no delays :) 核心数据iCloud支持仅使您可以跨设备增量更新数据库-如果需要,这非常好...几乎没有延迟:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM