立即XCode崩溃(Swift 2.2)

时间:2016-05-29 18:01:02

标签: ios arrays swift

我有这样的事情:

specialized _ContiguousArrayBuffer._checkValidSubscript(Int) -> () [inlined].

当我尝试调试我的代码,打印我的数组或我投入的项目的描述时,我的XCode关闭。

崩溃详情:

System Integrity Protection: enabled

Crashed Thread:        24  <DBGLLDBSessionThread (pid=666)>  Dispatch queue: DVTInvalidationPreventionQueue

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

你有什么想法吗?

1 个答案:

答案 0 :(得分:0)

当我尝试在nil对象

上使用属性时,我遇到了同样的错误
for trip: Trip in tripArray {
    NSLog("\(trip.hotel.name)") // hotel == nil
}