Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios restkit版本0.20上的fetchRequest-没有已知的类方法_Ios_Restkit_Nsfetchrequest - Fatal编程技术网

Ios restkit版本0.20上的fetchRequest-没有已知的类方法

Ios restkit版本0.20上的fetchRequest-没有已知的类方法,ios,restkit,nsfetchrequest,Ios,Restkit,Nsfetchrequest,在我的一个应用程序上,我正在从RestKit 0.10移动到0.20。我在上查看了页面,但没有看到此问题 编辑2013-02-09添加映射代码和loadObjectData方法* RestKit是通过CocoaPods添加的 这在RK0.10中运行,然后在RK0.20中编译。此片段的作用是: 创建获取请求 添加谓词 添加排序 获取中继器阵列 我有以下进口货物,以便: // RestKit #import <RestKit/RestKit.h> #import <RestKi

在我的一个应用程序上,我正在从RestKit 0.10移动到0.20。我在上查看了页面,但没有看到此问题

  • 编辑2013-02-09添加映射代码和loadObjectData方法*
RestKit是通过CocoaPods添加的

这在RK0.10中运行,然后在RK0.20中编译。此片段的作用是:

  • 创建获取请求
  • 添加谓词
  • 添加排序
  • 获取中继器阵列
  • 我有以下进口货物,以便:

    // RestKit
    #import <RestKit/RestKit.h>
    #import <RestKit/CoreData.h>
    
    // Core Data
    #import "Repeaters.h"
    
    中继器类的映射代码:

     RKManagedObjectMapping *repeatersMapping = [RKManagedObjectMapping mappingForEntityWithName:kEntityRepeaters inManagedObjectStore:objectStore];
     [repeatersMapping mapKeyPath:@"callSign" toAttribute:@"callSign"];
     [repeatersMapping mapKeyPath:@"country" toAttribute:@"country"];
     [repeatersMapping mapKeyPath:@"freqOffsetPl" toAttribute:@"freqOffsetPl"];
     [repeatersMapping mapKeyPath:@"grouping" toAttribute:@"grouping"];
     [repeatersMapping mapKeyPath:@"latitudeDefault" toAttribute:@"latitudeDefault"];
     [repeatersMapping mapKeyPath:@"longitudeDefault" toAttribute:@"longitudeDefault"];
     [repeatersMapping mapKeyPath:@"locationElevation" toAttribute:@"locationElevation"];
     [repeatersMapping mapKeyPath:@"node" toAttribute:@"node"];
     [repeatersMapping mapKeyPath:@"notes" toAttribute:@"notes"];
     [repeatersMapping mapKeyPath:@"repeaterId" toAttribute:@"repeaterId"];
     [repeatersMapping mapKeyPath:@"serviceArea" toAttribute:@"serviceArea"];
     [repeatersMapping mapKeyPath:@"serviceState" toAttribute:@"serviceState"];
     [repeatersMapping mapKeyPath:@"url" toAttribute:@"url"];
     repeatersMapping.primaryKeyAttribute = kEntityRepeaterKey;
     [wsiObjectManager.mappingProvider registerMapping:repeatersMapping withRootKeyPath:@"winSystem.winSystemRepeaters.winSystemRepeater"];
    
    loadObjectData方法:

    - (void)loadObjectData {
    
            [[RKObjectManager sharedManager] loadObjectsAtResourcePath:kWinSystemInfoXml delegate:self];
    }
    
    Xcode错误:


    *1 RepeatersTableViewController.m:116:37:选择器“fetchRequest”没有已知的类方法

    *2 RepeatersTableViewController.m:170:22:选择器“objectsWithFetchRequest:”没有已知的类方法


    这就像核心数据位没有添加到Repeaters类


    是否有其他关于v0.10到v0.20转换的文档可以帮助我查看更多更改?

    没有详细查看您的问题,已经回答了我的许多restkit.20问题。

    没有详细查看您的问题,已经回答了我的许多restkit.20问题。

    谢谢。我现在就从这里开始,谢谢你。我现在就从这里开始,你的要求呢?您是否可以提供更多的代码,因为似乎缺少一些东西。你使用对象映射吗?将此添加到您的答案中。
    sortedRequest
    是请求,而
    [Repeaters objectsWithFetchRequest:sortedRequest]调用使用该请求执行提取。托管对象映射代码已添加到问题中。好的,刚刚回顾了您的问题,并看到您实际尝试使用v.20运行RestKit v.10配置-由于进程已在v.20中重写,因此无法运行。查看发布的链接并编辑您的方法,让事情重新开始!是的,重新编码以匹配新方案。太糟糕了,它工作得很好。请求呢?您是否可以提供更多的代码,因为似乎缺少一些东西。你使用对象映射吗?将此添加到您的答案中。
    sortedRequest
    是请求,而
    [Repeaters objectsWithFetchRequest:sortedRequest]调用使用该请求执行提取。托管对象映射代码已添加到问题中。好的,刚刚回顾了您的问题,并看到您实际尝试使用v.20运行RestKit v.10配置-由于进程已在v.20中重写,因此无法运行。查看发布的链接并编辑您的方法,让事情重新开始!是的,重新编码以匹配新方案。太糟糕了,它工作得很好。
    
    - (void)loadObjectData {
    
            [[RKObjectManager sharedManager] loadObjectsAtResourcePath:kWinSystemInfoXml delegate:self];
    }