「未申報類型的錯誤使用」由於一個懸而未決的問題Cocoapod,我使用這些instructions手工嵌入Alamofire架構到應用中。所以,我的步驟是:IOS - 試圖在Xcode中使用嵌入式框架給出了
- 添加Alamofire作爲一個git子模塊,以我的應用程序
- 添加Alamofire.xcodeproj到我的應用程序的工作區
- 添加了iOS Alamofire.framework作爲嵌入式二進制到我的項目
儘管這樣,我仍然在運行到 「使用不明類型的」 錯誤:
import Foundation
import Alamofire
// Retry a request every x seconds
class AutoRetrier: RequestRetrier{
//MARK: Properties
private var maxRetries: Int
private var timeInterval: TimeInterval
init(times maxRetries:Int, interval:TimeInterval){
self.maxRetries = maxRetries
self.timeInterval = interval
}
//MARK: RequestRetrier
func should(_ manager: SessionManager, retry request: Request, with error: Error, completion: @escaping RequestRetryCompletion) {
// We're basically ignoring what type of error it is, and just retrying a number of times
if request.retryCount <= UInt(maxRetries){
completion(true, timeInterval)
} else{
completion(false, 0.0)
}
}
}
我該如何解決這個問題?