在设备上测试 iOS 应用程序时出现 RestKit 错误
在安装 Apple 的配置文件后尝试测试 iPhone 应用程序时,我收到了很多“语义问题”错误。
它在开发期间工作得很好,但是自从我设置了配置文件后,每次尝试构建时都会收到以下错误(选择我的物理设备时为 80,使用模拟器时为 10):
RKRequest.h: error: Semantic Issue: Redefinition of 'RKRequestMethod'
RKRequest.h: error: Semantic Issue: Redefinition of enumerator 'RKRequestMethodPOST'
...
我检索了 RestKit 的版本大约一个月前从其 git 存储库中获取,到目前为止它一直运行良好。
以下是错误详细信息的示例:
In file included from /Users/nick/Library/Developer/Xcode/DerivedData/MyApp-
bpcvkhxzjupqmibdvvipchdfecpi/Build/Products/Debug-
iphoneos/include/RestKit/CoreData/../ObjectMapping/../Network/RKClient.h:21:
我已尝试清除此目录,但问题仍然存在,并包含以下屏幕截图:
以下是如何在应用程序中使用 RestKit 的示例:
MyViewController.h
#import <RestKit/RestKit.h>
#import <RestKit/CoreData/CoreData.h>
@interface MyViewController : UIViewController<RKObjectLoaderDelegate, MFMailComposeViewControllerDelegate, UIActionSheetDelegate, SelectTranslationDelegate>
...
MyViewController.m
@interface MyViewController()
{
}
@end
...
@implementation MyViewController
...
我的链接库
有人对这可能的原因有任何建议吗?
I am receiving a lot of "sematic issue" errors when trying to test my iPhone application after installing my provisioning profile from Apple.
It has worked perfectly during the development period, however since I set up my provisioning profile, each time I try to build I receive the errors below (80 when my physical device is selected and 10 when using simulator):
RKRequest.h: error: Semantic Issue: Redefinition of 'RKRequestMethod'
RKRequest.h: error: Semantic Issue: Redefinition of enumerator 'RKRequestMethodPOST'
...
I retrieved the version of RestKit from its git repository about a month ago and it has been working perfectly until now.
Here is a sample from the error detail:
In file included from /Users/nick/Library/Developer/Xcode/DerivedData/MyApp-
bpcvkhxzjupqmibdvvipchdfecpi/Build/Products/Debug-
iphoneos/include/RestKit/CoreData/../ObjectMapping/../Network/RKClient.h:21:
I have tried clearing this directory but the problem persists and have included a screenshot below:
Here's an example of how RestKit is used in the app:
MyViewController.h
#import <RestKit/RestKit.h>
#import <RestKit/CoreData/CoreData.h>
@interface MyViewController : UIViewController<RKObjectLoaderDelegate, MFMailComposeViewControllerDelegate, UIActionSheetDelegate, SelectTranslationDelegate>
...
MyViewController.m
@interface MyViewController()
{
}
@end
...
@implementation MyViewController
...
My Linked Libraries
Does anybody have any suggestions as to why this might be?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从屏幕截图和我们的聊天对话中,我可以看出您正在使用过时的 RestKit 版本。最近,他们显着简化了构建过程并提交了许多 iOS5 修复程序,因此更新是值得的。
git pull
#import
。只需 #import "RestKit/RestKit.h"
即可解决问题libRestKit.a
和 < code>libxml2.dylibFrom the screenshots and our chat conversation i can tell you are using an outdated version of RestKit. Recently, they significantly simplified the build process and submitted a number of iOS5 fixes so the update is worth it.
git pull
in the RestKit directory#import <RestKit/CoreData/CoreData.h>
from your files. Just #import "RestKit/RestKit.h"
should do the tricklibRestKit.a
andlibxml2.dylib
作为初学者,请检查 Xcode 中的项目“构建阶段”,并确保“编译源”列表中的每个 RESTKit .m 文件(或杂散的 .h)没有超过一个条目。
As a starter, check your project 'Build Phases' in Xcode and make sure you have't got more than one entry for each of the RESTKit .m files (or a stray .h), in the 'Compile Sources' list.