在设备上测试iOS应用程序时出现RestKit错误

Nic*_*ick 2 xcode restkit

在从Apple安装我的配置文件后尝试测试我的iPhone应用程序时,我收到了很多"sematic问题"错误.

它在开发期间工作得很好,但是自从我设置配置文件后,每次尝试构建时都会收到以下错误(选择物理设备时为80,使用模拟器时为10):

RKRequest.h: error: Semantic Issue: Redefinition of 'RKRequestMethod' 
RKRequest.h: error: Semantic Issue: Redefinition of enumerator 'RKRequestMethodPOST' 
...
Run Code Online (Sandbox Code Playgroud)

我大约一个月前从它的git存储库中检索了RestKit的版本,直到现在它一直运行良好.

以下是错误详细信息的示例:

In file included from /Users/nick/Library/Developer/Xcode/DerivedData/MyApp-
bpcvkhxzjupqmibdvvipchdfecpi/Build/Products/Debug-
iphoneos/include/RestKit/CoreData/../ObjectMapping/../Network/RKClient.h:21:
Run Code Online (Sandbox Code Playgroud)

我已经尝试清除此目录,但问题仍然存在,并在下面包含了一个屏幕截图:

在此输入图像描述

这是一个如何在应用程序中使用RestKit的示例:

MyViewController.h

#import <RestKit/RestKit.h>
#import <RestKit/CoreData/CoreData.h> 

@interface MyViewController : UIViewController<RKObjectLoaderDelegate, MFMailComposeViewControllerDelegate, UIActionSheetDelegate, SelectTranslationDelegate>
...
Run Code Online (Sandbox Code Playgroud)

MyViewController.m

@interface MyViewController()
{
}
@end
...

@implementation MyViewController
...
Run Code Online (Sandbox Code Playgroud)

我的链接库

在此输入图像描述

有没有人对这可能是什么有任何建议?

mja*_*mja 9

从屏幕截图和我们的聊天对话中,我可以告诉您正在使用过时的RestKit版本.最近,他们大大简化了构建过程并提交了许多iOS5修复程序,因此更新是值得的.

  1. git pull在RestKit目录中运行
  2. #import <RestKit/CoreData/CoreData.h>从您的文件中删除.只是#import "RestKit/RestKit.h"应该做的伎俩
  3. 从"Link Binary With Libraries"中删除所有RestKit库,请务必添加新的libRestKit.alibxml2.dylib
  4. 尝试构建项目,如果发现任何错误,请尝试在管理器中删除派生数据.