我在Swift中使用Facebook iOS SDK访问Facebook,我希望使用FBGraphUser
(或FBGraphPlace
,FBGraphLocation
)协议,而不是使用纯Dictionary
。请求成功完成,但我无法将结果转换为FBProtocol
FBRequestConnection.startForMeWithCompletionHandler { (connection: FBRequestConnection!, result: AnyObject!, error: NSError!) -> Void in
// this does not work
if let fbGraphUser = result as? FBGraphUser {
NSLog("\(fbGraphUser)")
}
// this works
if let fbGraphUserDict = result as? Dictionary<String, AnyObject>{
println("\(fbGraphUserDict)")
}
}
我应该如何打开选项以获取FBxxxx对象?
欢呼声