我想在我的應用程序FB登錄後檢索電子郵件ID。但是,當我嘗試從結果中獲取值時,出現錯誤。類型「否?」有沒有標會員
的錯誤是:Type 'Any?' has no subscript members
。
func fetchProfile()
{
print("Fetch Profile")
let parameters = ["fields": "email, first_name, last_name, picture.type(large)"]
FBSDKGraphRequest(graphPath: "me", parameters: parameters).start { (connection, result, error) in
let email = result["email"] as? String //Type 'Any?' has no subscript members error occurs here.
}
}
這可能幫助:http://stackoverflow.com/questions/39516199/type-any-has-no-下標 - 成員在Xcode-8-swift-3/39516303#39516303 –