Ric*_*opo -1 exc-bad-access ios swift
我有以下代码:
// Get the matches
var recipieMatches = queryResults[MATCHES_INDEX] as Array<Dictionary<String, AnyObject>>
// Set some global vars
var numberOfRecipiesToDisplay: Int = recipieMatches.count
for i in 0...(numberOfRecipiesToDisplay - 1)
{
var time: Int? = ((recipieMatches[i])["totalTimeInSeconds"]) as Int? // THIS LINE
}
Run Code Online (Sandbox Code Playgroud)
我在for循环中的行上得到一个EXC_BAD_ACCESS错误.
我的问题:这怎么可能?我知道recipieMatches[i]是一个值,因为for循环遍历数组的计数.
| 归档时间: |
|
| 查看次数: |
700 次 |
| 最近记录: |