【发布时间】:2016-01-07 04:34:43
【问题描述】:
我必须返回这个函数的一个值。我在这一行出现错误
func GetStation(url : String, completionHandler: (stationDictionary: NSDictionary) -> ()) {
getResonse(url, completionhandler: { (dict) -> NSDictionary in
completionHandler(stationDictionary: dict) // Error on this line
})
}
【问题讨论】:
-
您能打印出您收到的回复吗?
-
我的代码没有执行他们显示错误
-
completionHandler(stationDictionary: dict) as? NSDictionary 当我使用此行代码执行获取响应但在此行崩溃
-
试试
completionHandler(stationDictionary: dict as? NSDictionary) -
你能透露网址吗?您还使用任何框架吗?