【发布时间】:2016-09-26 21:04:35
【问题描述】:
我已尝试解决此警告,但没有成功。自从升级到 swift3 后,我在我的 Facebook 图形请求完成处理程序中收到一条警告消息。
错误信息具体为“'FBSDKGraphRequestConnection?'类型的表达式未使用。”
graphRequest?.start(completionHandler: { (connection, result, error) in
if error != nil {
//do something with error
} else if result != nil {
//do something with result
}
})
我尝试添加(在完成处理程序中)如下代码行,以查看警告是否会消失但警告是否持续存在。
connection.start()
connection.timeout = 30
if connection != nil {
}
我在 swift2 中运行良好的完成处理程序并没有给我这样的警告。我没有正确使用完成处理程序吗?
【问题讨论】:
标签: xcode facebook-graph-api connection swift3 completionhandler