0

我在我的项目中使用 restkit 我试图通过以下方式设置解析器的配置

[[RKParserRegistry sharedRegistry] setParserClass:[RKJSONParserJSONKit class] forMIMEType:@"text/javascript"];

我在 restkit 文档中导入了解析器的库

#import <RestKit/JSONKit.h>

但总是错误

使用未声明的标识符“RKJSONParserJSONKit”

我也尝试通过从其位置导入标头来修复它:

#import <RestKit/Code/Support/Parsers/JSON/RKJSONParserJSONKit.h>  

它不起作用,但是当我尝试复制解析器所需的文件并将其作为文件添加到我的项目中时,liker 给了我:

重复符号 _OBJC_METACLASS_$_RKJSONParserJSONKit 在:/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/RKJSONParserJSONKit.o /Users/reserveout/Desktop/ReserveOutApplication/ Build/Products/Debug-iphonesimulator/libRestKit.a(RKJSONParserJSONKit.o) 重复符号 _OBJC_CLASS_$_RKJSONParserJSONKit 在:/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects- normal/i386/RKJSONParserJSONKit.o /Users/reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/libRestKit.a(RKJSONParserJSONKit.o) 重复符号 _RKLogInitialize 在:/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/RKLog.o /Users/reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator /libRestKit.a(RKLog.o) 重复符号 _RKLogConfigureFromEnvironment 在:/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/RKLog.o /Users /reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/libRestKit.a(RKLog.o) 重复符号 _RKLogLevelForString 在:/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication .build/Objects-normal/i386/RKLog.o /Users/reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/libRestKit.a(RKLog.o) 重复符号_RKLogValidationError in:/Users/reserveout/Desktop/ReserveOutApplication/ Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/RKLog.o /Users/reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/libRestKit.a(RKLog.o)重复符号 _RKLogIntegerAsBinary 在:/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/RKLog.o /Users/reserveout/Desktop/ReserveOutApplication/Build/ Products/Debug-iphonesimulator/libRestKit.a(RKLog.o) 重复符号 _lcl_configure_by_component 在:/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/lcl.o /Users/reserveout/Desktop/ReserveOutApplication/ Build/Products/Debug-iphonesimulator/libRestKit.a(lcl.o) 重复符号 _lcl_configure_by_identifier 在:/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/ i386/lcl.o /Users/reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/libRestKit.a(lcl.o) 重复符号 __lcl_component_identifier 在:/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication。build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/lcl.o /Users/reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/libRestKit.a(lcl.o) 重复符号_lcl_configure_by_header in:/用户/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/lcl.o /Users/reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/ libRestKit.a(lcl.o) 重复符号 __lcl_component_header 在:/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/lcl.o /Users/ Reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/libRestKit。一个(lcl.o)重复符号_lcl_configure_by_name在:/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/lcl.o/Users/reserveout/ Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/libRestKit.a(lcl.o) 重复符号 __lcl_component_name 在:/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/ Objects-normal/i386/lcl.o /Users/reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/libRestKit.a(lcl.o) 重复符号__lcl_level_header in:/Users/reserveout/Desktop/ReserveOutApplication/Build/中间体/ReserveOutApplication。build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/lcl.o /Users/reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/libRestKit.a(lcl.o) 重复符号__lcl_level_header_1 in:/用户/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/lcl.o /Users/reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/ libRestKit.a(lcl.o) 重复符号 __lcl_level_header_3 在:/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/lcl.o /Users/ Reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/libRestKit.a(lcl.o) 重复符号 __lcl_level_name 在:/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/lcl.o /Users/reserveout/Desktop/ReserveOutApplication/ Build/Products/Debug-iphonesimulator/libRestKit.a(lcl.o) 重复符号 __lcl_version 在:/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/ i386/lcl.o /Users/reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/libRestKit.a(lcl.o) ld:架构 i386 clang 的 19 个重复符号:错误:链接器命令失败,退出代码 1(使用 -v 查看调用)/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/lcl.o /Users/reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator /libRestKit.a(lcl.o) 重复符号 __lcl_version 在:/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/lcl.o /Users /reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/libRestKit.a(lcl.o) ld:架构 i386 clang 的 19 个重复符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/lcl.o /Users/reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator /libRestKit.a(lcl.o) 重复符号 __lcl_version 在:/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/lcl.o /Users /reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/libRestKit.a(lcl.o) ld:架构 i386 clang 的 19 个重复符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)build/Objects-normal/i386/lcl.o /Users/reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/libRestKit.a(lcl.o) 重复符号 __lcl_version 在:/Users/reserveout/Desktop/ReserveOutApplication/ Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/lcl.o /Users/reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/libRestKit.a(lcl.o) ld:架构 i386 的 19 个重复符号 clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)build/Objects-normal/i386/lcl.o /Users/reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/libRestKit.a(lcl.o) 重复符号 __lcl_version 在:/Users/reserveout/Desktop/ReserveOutApplication/ Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/lcl.o /Users/reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator/libRestKit.a(lcl.o) ld:架构 i386 的 19 个重复符号 clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/lcl.o /Users/reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator /libRestKit.a(lcl.o) ld:架构 i386 的 19 个重复符号 clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)/Users/reserveout/Desktop/ReserveOutApplication/Build/Intermediates/ReserveOutApplication.build/Debug-iphonesimulator/ReserveOutApplication.build/Objects-normal/i386/lcl.o /Users/reserveout/Desktop/ReserveOutApplication/Build/Products/Debug-iphonesimulator /libRestKit.a(lcl.o) ld:架构 i386 的 19 个重复符号 clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

4

1 回答 1

0
  1. RestKit 默认配置为使用 JSONKit
  2. 您的导入错误,这不会导入您想要的内容。

试试这个,但这是 Wile E. Coyote 的解决方案

#import "RestKit/Code/Support/Parsers/JSON/RKJSONParserJSONKit.h"  

3.如果真的要复制资源,只复制头文件,不要复制源文件(.m)

于 2012-11-05T08:53:47.190 回答