【问题标题】:RestKit loads of errors, am I doing it wrong?RestKit 大量错误,我做错了吗?
【发布时间】:2016-04-03 10:59:31
【问题描述】:

我已经在我的新项目中使用 CocoaPods 安装了 RestKit,来试用一下。

我确实按照https://github.com/RestKit/RestKit 中的步骤进行操作。

我创建了以下 Podfile:

# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
use_frameworks!

target 'MyProject' do

pod 'UIColor_Hex_Swift', '~> 2.1'
pod 'RestKit', '~> 0.24.0'

end

它与链接的ios版本不同,他们使用的是5.0。

我做了pod install。一切似乎都很好:

Updating local specs repositories

CocoaPods 1.0.0.beta.6 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.

For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.

Analyzing dependencies
Downloading dependencies
Using AFNetworking (1.3.4)
Using ISO8601DateFormatterValueTransformer (0.6.1)
Using RKValueTransformers (1.1.3)
Using RestKit (0.24.1)
Using SOCKit (1.1)
Using TransitionKit (2.1.1)
Using UIColor_Hex_Swift (2.1)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 2 dependencies from the Podfile and 7 total pods installed.

我确实以open MyProject.xcworkspace 开头。

但是,如果编译错误,我会收到负载:

我错过了什么明显的东西吗?

我的 git 被推荐了:

git --version
git version 2.6.4 (Apple Git-63)

【问题讨论】:

  • 我认为你应该做'pod update',而不是'install'。同时删除任何版本说明符。最新版本是 0.26,顺便说一句。

标签: ios objective-c restkit


【解决方案1】:

我认为您应该执行“pod update”,而不是“install”。同时删除任何版本说明符。顺便说一句,最新版本是 0.26。

【讨论】:

  • 好的。我只是按照自述文件。 "安装到你的项目中:$ pod install"
  • v0.26.0 是您需要的关键信息,RestKit 的版本和 CocoaPods 的版本需要匹配,因为不久前 CocoaPods 进行了重大更改......
【解决方案2】:

我已经让 RestKit 0.26.0 与 Cocoapods 1.0.1 一起使用,在一个使用 Xcode 7.3 的 Swift 项目中,我写了一个答案 here

短版:

先清理旧的 pod

在 AFNetwork 分支中使用 mcfedr's RestKit fork

pod 'AFNetworking', :git => 'https://github.com/mcfedr/AFNetworking.git', :branch => 'reachability'
pod 'RestKit', :git => 'https://github.com/mcfedr/RestKit.git', :branch => 'pods1'

在桥接头中使用模块导入语法

@import RestKit;

现在应该可以了

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-12-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多