Ios 如何找到应用程序崩溃的位置?

Ios 如何找到应用程序崩溃的位置?,ios,iphone,xcode,ipad,Ios,Iphone,Xcode,Ipad,以下是日志: Crashed: com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x0000000c 0 libobjc.A.dylib objc_msgSend + 5 respondsToSelector: 1 CoreLocation (null) + 23946 2 CoreLocation (null) + 5230 3 CoreLocation (null) + 972 4 Co

以下是日志:

Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x0000000c

0   libobjc.A.dylib 
objc_msgSend + 5
respondsToSelector:
1
CoreLocation    
(null) + 23946
2
CoreLocation    
(null) + 5230
3
CoreLocation    
(null) + 972
4
CoreFoundation  
__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
5
CoreFoundation  
__CFRunLoopDoBlocks + 216
6
CoreFoundation  
__CFRunLoopRun + 1714
7
CoreFoundation  
CFRunLoopRunSpecific + 476
8
CoreFoundation  
CFRunLoopRunInMode + 106
9
GraphicsServices    
GSEventRunModal + 136
10  UIKit   
UIApplicationMain + 1440
11
Wines   
main.m line 40
main

在Mac上,您可以在控制台应用程序的“用户诊断报告”下找到崩溃的回溯

在那里你可以找到崩溃文件。由于崩溃可能发生在自定义代码中,因此可能会发送一些可疑值

您无法知道崩溃发生在哪里,因为您的回溯已被剥离。所以,要么尝试用调试符号编译代码,要么使用dtrace/dtrus调试应用程序

objc_msgSend是Objective-C的标准函数

另请阅读:

  • 可笑的鱼
  • 在开源苹果公司

文本编辑器左侧通常有一个绿色箭头(灰色区域)。关于此错误,首先想到的是检查断点周围的任何对象是否为NULL/nil。这不是每次都发生的。我有这么多变量和对象,很难找到哪一个设置为NULL/NIL。我知道对象正在尝试读取内存,并且该内存正在重新调整为NULL。我如何才能找到它?我启用NSZombie并尝试查看发生了什么?但正如我所说,这并不是每次都会发生。