3

我有一个现有的 Core Data 应用程序,现在我想为我的对象的远程存储添加 REST 支持。我决定集成 RestKit,因为这似乎是(迄今为止)最成熟的 REST 支持框架,但对它的核心数据集成部分还有些不清楚。

由于到目前为止我有一个工作应用程序,我不想将所有核心数据工作完全交给 RestKit,但似乎我不能告诉 RestKit 映射 NSManagedObjects,除非我也让它管理对象存储。我得出这个结论是因为 RKManagedObjectMapping 类在为托管类设置映射时需要 RKManagedObjectStore。RKManagedObjectStore 似乎希望通过其各种初始化程序来控制数据库文件。

这个对吗?

理想情况下,我想像现在一样维护我的本地商店,并通过 RestKit 添加“远程处理”功能。想到的唯一方法是拥有我的核心数据类的远程变体,并使用它们在两个模型之间进行代理。

我忍不住想我错过了什么。任何指针或示例代码将不胜感激。

4

1 回答 1

0

As I understand it RestKit does not take over the management. They just wrap it and adds convenience methods to make setting up and getting to the managed objects easier. I tried it with my data on the simulator past couple of weeks and have no issues. I have yet to deploy this change to the device but soon. So let's suppose you already have an RKObjectMananger initialized. Let me know if this helps.

于 2012-09-19T23:31:56.313 回答