gpt4 book ai didi

swift - 使用 CocoaPods 和 xcode 6.3 的 Alamofire

转载 作者:行者123 更新时间:2023-11-28 09:09:51 25 4
gpt4 key购买 nike

总的来说,我是 swift 和 xCode 的新手,我已经安装了 Cocoapods 并且有一个新的 xcode 项目。

我能够添加其他库,但是当我尝试加载 alamofire 库时,出现大约 48 个错误。

我的 Podfile 看起来像这样:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'TwilioSDK'
pod 'Alamofire', '~> 1.2'

当我尝试构建应用程序时,我得到以下信息:

/****/Pods/Alamofire/Source/Alamofire.swift
/****/Pods/Alamofire/Source/Alamofire.swift:82:93: Expected type after 'as'
/****/Pods/Alamofire/Source/Alamofire.swift:222:19: Static properties are only allowed within structs and enums; use 'class' to declare a class property
/****/Pods/Alamofire/Source/Alamofire.swift:234:19: Static properties are only allowed within structs and enums; use 'class' to declare a class property
/****/Pods/Alamofire/Source/Alamofire.swift:241:84: Expected type after 'as'
/****/Pods/Alamofire/Source/Alamofire.swift:241:84: Expected ',' separator
/****/Pods/Alamofire/Source/Alamofire.swift:241:84: Expected expression in list of expressions
/****/Pods/Alamofire/Source/Alamofire.swift:263:59: Expected type after 'as'
/****/Pods/Alamofire/Source/Alamofire.swift:268:10: Consecutive statements on a line must be separated by ';'
/****/Pods/Alamofire/Source/Alamofire.swift:821:61: Expected type after 'as'
/****/Pods/Alamofire/Source/Alamofire.swift:937:43: Expected '{' after 'if' condition
/****/Pods/Alamofire/Source/Alamofire.swift:939:13: Braced block of statements is an unused closure
/****/Pods/Alamofire/Source/Alamofire.swift:942:14: Consecutive statements on a line must be separated by ';'
/****/Pods/Alamofire/Source/Alamofire.swift:942:15: Expected expression
/****/Pods/Alamofire/Source/Alamofire.swift:942:20: Braced block of statements is an unused closure
/****/Pods/Alamofire/Source/Alamofire.swift:968:59: Expected '{' after 'if' condition
/****/Pods/Alamofire/Source/Alamofire.swift:972:70: Expected '{' after 'if' condition
/****/Pods/Alamofire/Source/Alamofire.swift:1141:65: Expected type after 'as'
/****/Pods/Alamofire/Source/Alamofire.swift:1176:65: Expected type after 'as'
/****/Pods/Alamofire/Source/Alamofire.swift:1176:65: Expected ',' separator
/****/Pods/Alamofire/Source/Alamofire.swift:1176:65: Expected expression in list of expressions
/****/Pods/Alamofire/Source/Alamofire.swift:1260:69: Expected type after 'as'
/****/Pods/Alamofire/Source/Alamofire.swift:1335:67: Expected type after 'as'
/****/Pods/Alamofire/Source/Alamofire.swift:1335:67: Expected ',' separator
/****/Pods/Alamofire/Source/Alamofire.swift:1335:67: Expected expression in list of expressions
/****/Pods/Alamofire/Source/Alamofire.swift:1348:71: Expected '{' after 'if' condition
/****/Pods/Alamofire/Source/Alamofire.swift:1351:9: Braced block of statements is an unused closure
/****/Pods/Alamofire/Source/Alamofire.swift:1379:43: Expected '{' after 'if' condition
/****/Pods/Alamofire/Source/Alamofire.swift:1381:9: Braced block of statements is an unused closure
/****/Pods/Alamofire/Source/Alamofire.swift:222:12: Static variables not yet supported
/****/Pods/Alamofire/Source/Alamofire.swift:234:12: Static variables not yet supported
/****/Pods/Alamofire/Source/Alamofire.swift:241:51: Type '()' does not conform to protocol 'SequenceType'
/****/Pods/Alamofire/Source/Alamofire.swift:253:33: Function produces expected type 'String'; did you mean to call it with '()'?
/****/Pods/Alamofire/Source/Alamofire.swift:106:43: Use of unresolved identifier 'mutableURLRequest'
/****/Pods/Alamofire/Source/Alamofire.swift:122:17: Use of unresolved identifier 'mutableURLRequest'
/****/Pods/Alamofire/Source/Alamofire.swift:123:17: Use of unresolved identifier 'mutableURLRequest'
/****/Pods/Alamofire/Source/Alamofire.swift:127:17: Use of unresolved identifier 'mutableURLRequest'
/****/Pods/Alamofire/Source/Alamofire.swift:128:17: Use of unresolved identifier 'mutableURLRequest'
/****/Pods/Alamofire/Source/Alamofire.swift:131:28: Use of unresolved identifier 'mutableURLRequest'
/****/Pods/Alamofire/Source/Alamofire.swift:134:17: Use of unresolved identifier 'mutableURLRequest'
/****/Pods/Alamofire/Source/Alamofire.swift:190:19: Operand of postfix '!' should have optional type; type is 'NSURL'
/****/Pods/Alamofire/Source/Alamofire.swift:939:13: Type of expression is ambiguous without more context
/****/Pods/Alamofire/Source/Alamofire.swift:942:20: Type of expression is ambiguous without more context
/****/Pods/Alamofire/Source/Alamofire.swift:970:13: Type of expression is ambiguous without more context
/****/Pods/Alamofire/Source/Alamofire.swift:1312:38: Operand of postfix '!' should have optional type; type is 'NSURL'
/****/Pods/Alamofire/Source/Alamofire.swift:1333:65: Operand of postfix '!' should have optional type; type is 'NSURL'
/****/Pods/Alamofire/Source/Alamofire.swift:1351:9: Type of expression is ambiguous without more context
/****/Pods/Alamofire/Source/Alamofire.swift:1382:39: Use of unresolved identifier 'escapedBody'
/****/Pods/Alamofire/Source/Alamofire.swift:1385:35: Operand of postfix '!' should have optional type; type is 'NSURL'

最佳答案

我有同样的问题,但是通过降级到较低版本的 Alamofire (1.1.4) 并手动安装而不是使用 cocoapods 来解决这个问题。

关于swift - 使用 CocoaPods 和 xcode 6.3 的 Alamofire,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29580690/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com