RestKit 中 RKManagedObject 的下一步是什么

what's the next of RKManagedObject in RestKit

刚刚看了github上的tutorial,发现了一些关于Core Data的对象方法,比如fetchRequestobjectWithPrimaryKeyValue等等。然后我google了一下,都是来自RKManagedObject,在最新版本的Restkit中已经弃用了,所以当前版本的Restkit是否提供类似API的NSManagedObject?

还是只涉及第三方项目,比如MagicalRecord?如果是这样,我不确定它们是否兼容,因为核心数据由 RestKit 大量处理。例如,如果我想使用 MagicalRecord,我需要根据官方文档使用以下方法之一对其进行初始化。我猜我的应用程序将有两个主要上下文,一个由 RestKit 处理,另一个由 MagicalRecord.

处理
+ (void)setupCoreDataStack;
+ (void)setupAutoMigratingCoreDataStack;
+ (void)setupCoreDataStackWithInMemoryStore;
+ (void)setupCoreDataStackWithStoreNamed:(NSString *)storeName;
+ (void)setupCoreDataStackWithAutoMigratingSqliteStoreNamed:(NSString *)storeName;
+ (void)setupCoreDataStackWithStoreAtURL:(NSURL *)storeURL;
+ (void)setupCoreDataStackWithAutoMigratingSqliteStoreAtURL:(NSURL *)storeURL;

Restkit是做映射的,不是给核心数据提供不同的接口。因此,您可以在 NSManagedObjectContext+RKAdditions.h 中获得一些东西,例如节省支持,但除此之外什么都没有。

您应该考虑使用 mogenerator,如果您想要它提供的其他功能,请考虑使用魔法记录。