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

发布于 2024-12-23 20:43:36 字数 1328 浏览 0 评论 0原文

在安装 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:

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

enter image此处描述

以下是如何在应用程序中使用 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:

enter image description here

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

enter image description here

Does anybody have any suggestions as to why this might be?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

乖乖公主 2024-12-30 20:43:36

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

  1. 在 RestKit 目录中运行 git pull
  2. 从文件中删除 #import 。只需 #import "RestKit/RestKit.h" 即可解决问题
  3. 从“Link Binary With Libraries”中删除所有 RestKit 库,请务必添加新的 libRestKit.a 和 < code>libxml2.dylib
  4. 尝试构建项目,如果看到任何错误,请尝试删除管理器中的派生数据。

From 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.

  1. run git pull in the RestKit directory
  2. remove #import <RestKit/CoreData/CoreData.h> from your files. Just #import "RestKit/RestKit.h" should do the trick
  3. Remove all RestKit libs from "Link Binary With Libraries", be sure to add new libRestKit.a and libxml2.dylib
  4. Try building the project, if you see any errors try removing derived data in Organizer.
如歌彻婉言 2024-12-30 20:43:36

作为初学者,请检查 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文