我得到了这样的东西:
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
你有什么想法吗?
最佳答案
当我试图在 nil
对象上使用属性时,我遇到了同样的错误
for trip: Trip in tripArray {
NSLog("\(trip.hotel.name)") // hotel == nil
}
关于ios - XCode 立即崩溃(Swift 2.2),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37513172/