我在 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 对象?
干杯