4

在启用 ARC 的新创建的 Xcode 项目中,有警告消息RKRequest.m

Semantic Issue:
Instance method '-hostAndPort' not found (return type defaults to 'id')
Semantic Issue:
Class method '+URLRequestForPath:PUTParameters:scheme:host:consumerKey:consumerSecret:accessToken:tokenSecret:' not found (return type defaults to 'id')
Semantic Issue:
Instance method '-hostAndPort' not found (return type defaults to 'id')
Semantic Issue:
Class method '+URLRequestForPath:POSTParameters:scheme:host:consumerKey:consumerSecret:accessToken:tokenSecret:' not found (return type defaults to 'id')
Semantic Issue:
Instance method '-hostAndPort' not found (return type defaults to 'id')

这是Podfile

platform :ios

dependency 'Facebook-iOS-SDK', '1.2'
dependency 'RestKit', '0.10.1'

和:

cocoapods (0.6.0.rc2)

如何修复警告?

更新:

经过进一步调查,似乎 CocoaPods 依赖于一个过时的cocoa-oauth库,这在本期中有描述。于是问题就变成了:

4

2 回答 2

0

将此添加到您的 .m 源

#import < RestKit/RestKit.h >

和 lib 到你的项目

见相关

RestKit/RestKit.h 文件未找到错误 - 版本 0.10.0

于 2012-06-18T18:58:04.500 回答
0

我对cocoapods一无所知,但我知道你的警告。这些警告意味着在标头中找不到您尝试发送对象的消息。

这可能意味着几件事:

- the header file is not in the search path of your build settings. 
- the header file does not exist.
- the header file is not included in your project.
- the methods do not exist at all or do not exist in your header.

确保您正在导入 RKRequest.h 文件并且该文件位于搜索路径中。请记住,如果 RKRequest.m 是框架或库的一部分,您的项目仍然需要标头。

于 2012-06-18T06:11:40.437 回答