【问题标题】:ObjectMapper, Carthage, and Xcode 6.3 errorObjectMapper、Carthage 和 Xcode 6.3 错误
【发布时间】:2015-05-01 08:34:35
【问题描述】:

有一个项目使用 Carthage 作为依赖项。最近更新到 Xcode 6.3 和 Swift 1.2。发生这种情况时,我还必须更新我现在的 Cartfile:

github "Alamofire/Alamofire" >= 1.2

github "SwiftyJSON/SwiftyJSON" >= 2.2

github "Hearst-DD/ObjectMapper" ~> 0.9

ObjectMapper 似乎无法编译。运行“迦太基更新”时,我得到:

The following build commands failed:
CompileSwift normal x86_64 .../Carthage/Checkouts/ObjectMapper/ObjectMapper/Core/Mapper.swift
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(2 failures)

看起来开发 ObjectMapper 的人已经包含了支持最新 Swift/Xcode 的更改,并且没有看到其他人在这方面存在问题。对此错误消息的任何见解将不胜感激:)

【问题讨论】:

    标签: swift xcode6 carthage


    【解决方案1】:

    ObjectMapper 0.9 版不包括​​对 swift 1.2/Xcode 6.3 的支持。如果你使用最新的,你应该很高兴:

    “Hearst-DD/ObjectMapper”~> 0.11

    【讨论】:

    • 如果你使用 ObjectMapper 来映射 HTTP 响应,你应该考虑使用AlamofireObjectMapper。它是 Alamofire 的一个简单扩展,它使用 ObjectMapper 自动将您的响应转换为 swift 对象。全面披露:我是 ObjectMapper 和 AlamofireObjectMapper 的作者
    • 我将 AlamofireObjectMapper 用于 swift 1.2。使用以下命令安装它“pod 'AlamofireObjectMapper', '~> 0.7'”。但由于某种奇怪的原因,它正在下载仅支持 swift 2.0 的 0.9 版本,我的项目遇到了麻烦。你能告诉为什么会这样吗?谢谢
    • @LinkonSid 如果您将 podfile 行更改为以下 pod 'AlamofireObjectMapper', '0.7' 我认为应该可以解决您的问题。有关 podfile 依赖语法的详细信息,请参阅guides.cocoapods.org/syntax/podfile.html#pod
    • 这似乎有效。但是问题仍然存在。它正在安装 objectmapper 0.19 版本。但我需要 0.15 版本的 swift 1.2 有什么解决方案吗??
    猜你喜欢
    • 2015-06-29
    • 2015-09-13
    • 1970-01-01
    • 2015-06-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多