Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/115.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 为什么数据返回零?_Ios_Swift_Stripe Payments - Fatal编程技术网

Ios 为什么数据返回零?

Ios 为什么数据返回零?,ios,swift,stripe-payments,Ios,Swift,Stripe Payments,我试图访问对象中的数据,但打印时得到的是零。为什么会发生这种情况?我该如何解决 数据的内容是一个数组()->Array–{}->字典即使我打印(“卡\(成功![“数据”]!![8])”它也会打印nil@vadian我做得对吗?不,如果让数据=成功,请尝试![“数据”]作为?[[String:AnyObject]{print(数据[0][“brand”!)}如果有多张卡怎么办?我需要更改数据。首先,但是更改为什么?然后是data[indexNumber],其中indexNumber是一个整数。

我试图访问对象中的数据,但打印时得到的是零。为什么会发生这种情况?我该如何解决


数据的内容是一个数组
()
->Array–
{}
->字典即使我打印(“卡\(成功![“数据”]!![8])”
它也会打印nil@vadian我做得对吗?不,如果让数据=成功,请尝试
![“数据”]作为?[[String:AnyObject]{print(数据[0][“brand”!)}
如果有多张卡怎么办?我需要更改
数据。首先
,但是更改为什么?然后是data[indexNumber],其中indexNumber是一个整数。
 print("card \(success!["data"]!!["brand"])")
guard let success = result as? [String: AnyObject] else { return }
let data = success["data"] as! [AnyObject]
let firstObject = data.first! as! [String: AnyObject]
print(firstObject["brand"] as! String)