在Swift 3中将any转换为customObject

时间:2017-09-21 11:29:05

标签: swift

我无法将结果转换为IeroLocationSave对象。下面的鳕鱼e说 - 在强制

中不能将任何值转换为IeroLocationSave类型

var model = IeroLocationSave!.self

    libName.fetchDataUsingPost(forURL: url, parameters: parameters, headerFiled: [:], completionHandler: {(result: Any?)-> Void in
        let json = result
        print("json value",json!)
        model = result! as IeroLocationSave
        print("actualResponse",result as? [String: AnyObject])
        // guard let json = result as? [String: AnyObject] else{∫

        // }


    }, failureHandler: {(result: Error?)-> Void in
        print("error", result ?? "nil")})

0 个答案:

没有答案