无法转换('AnyObject?,NSError? - &gt; Void'为'CompletionBlock'(又名'(可选<any>,可选<error>) - &gt;()')

时间:2017-07-11 07:44:54

标签: swift xcode

fileprivate func playVideoId(_ apiId: String) {

    (MApi.sharedMApi() as! MApi).getVideoALaCarta(withID: apiId, completionHandler: { [weak self] (videoObject: AnyObject?, error: NSError?) -> Void in

        if ((error) != nil || (videoObject) == nil) {
            print("ERROR AL DESCARGAR VIDEO A LA CARTA: \(String(describing: error))")
            self?.userInterface?.showLoadingView(false)
        } else {
            self?.userInterface?.presentPlayer(videoObject as! MApi_VideoAlaCarta)
        }
        } as CompletionBlock)
}

和CompletionBlock代码:

$ typedef void(^ CompletionBlock)(id对象,NSError *错误);

0 个答案:

没有答案