【发布时间】:2016-03-29 15:39:08
【问题描述】:
【问题讨论】:
【问题讨论】:
ambiguous错误发生在对象类型为AnyObject且编译器不知道该对象是否可以键下标时。
解决方案是将result 转换为合适的值。
好像是字典
if let dict = result as? [String:AnyObject] {
let userId = dict["id"] as! String
...
}
【讨论】:
您必须定义result 类型,例如,如果这是一个字典尝试:
let dic: NSDictionary = result
let userId: String = dic["id"] as! String
【讨论】: