我在 Xcode 制作的 iOS 游戏中遇到 EXC_BAD_ACCESS 异常。它发生在模拟器和真实设备上。它总是在游戏中的同一部分,但并不总是发生。它很神秘,因为它似乎与游戏的对象没有任何关系,只是与默认的库/系统方法有关。Xcode 也没有显示是哪一行代码导致了它(但它显示了汇编中的哪一行)。我在下面发布回溯。可能是什么原因造成的?我怎样才能找出问题所在?
thread #1: tid = 0x1c03, 0x01980051 libobjc.A.dylib`_cache_getImp + 9, stop reason = EXC_BAD_ACCESS (code=1, address=0xc0000008)
frame #0: 0x01980051 libobjc.A.dylib`_cache_getImp + 9
frame #1: 0x0196dac4 libobjc.A.dylib`lookUpMethod + 42
frame #2: 0x0196da88 libobjc.A.dylib`class_respondsToSelector + 65
frame #3: 0x023160d3 CoreFoundation`objectIsKindOfClass + 51
frame #4: 0x0239f087 CoreFoundation`__handleUncaughtException + 71
frame #5: 0x0196f0b9 libobjc.A.dylib`_objc_terminate() + 86
frame #6: 0x01da2a65 libc++abi.dylib`safe_handler_caller(void (*)()) + 13
frame #7: 0x01da2acd libc++abi.dylib`std::terminate() + 23
frame #8: 0x01da3c4e libc++abi.dylib`__cxa_rethrow + 83
frame #9: 0x0196efbd libobjc.A.dylib`objc_exception_rethrow + 47
frame #10: 0x022bbf98 CoreFoundation`CFRunLoopRunSpecific + 360
frame #11: 0x022bbe1b CoreFoundation`CFRunLoopRunInMode + 123
frame #12: 0x01df57e3 GraphicsServices`GSEventRunModal + 88
frame #13: 0x01df5668 GraphicsServices`GSEventRun + 104
frame #14: 0x00aa5ffc UIKit`UIApplicationMain + 1211
frame #15: 0x000026e1 Game`main(argc=1, argv=0xbffff3bc) + 95 at main.m:6
frame #16: 0x00002645 Game`start + 53