ios - iOS中的自动旋转崩溃
<p><p>当我更改设备方向时,我正在使用的应用程序出现异常终止(崩溃)。我无法经常重现它(当我旋转时它并不总是发生,假设机会大约在 0.01% 左右),但这是一个严重的问题。我附上了崩溃报告的重要部分。</p>
<pre><code>Exception Type:EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x6563616e
Crashed Thread:0
Thread 0 name:Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x3233a5b0 objc_msgSend + 16
1 UIKit 0x36297b82 - + 1546
2 UIKit 0x3628301e - + 310
3 UIKit 0x3628358c - + 48
4 UIKit 0x36283400 - + 324
5 UIKit 0x362cc8b4 - + 252
6 UIKit 0x362cc544 - + 220
7 UIKit 0x362c59c4 - + 644
8 UIKit 0x362c572e - + 262
9 UIKit 0x3644eb2a - + 38
10CoreFoundation 0x35b63aec __NSArrayChunkIterate + 360
11CoreFoundation 0x35b5ca74 __NSArrayEnumerate + 608
12CoreFoundation 0x35abeb66 - + 58
13UIKit 0x3627e09e - + 114
14UIKit 0x36263ba2 - + 414
15UIKit 0x362c59c4 - + 644
16UIKit 0x362c572e - + 262
17CoreFoundation 0x35b63aec __NSArrayChunkIterate + 360
18CoreFoundation 0x35b5ca74 __NSArrayEnumerate + 608
19CoreFoundation 0x35abeb66 - + 58
20UIKit 0x3627e09e - + 114
21UIKit 0x36263ba2 - + 414
22UIKit 0x362a6dc0 - + 48
23UIKit 0x362c59c4 - + 644
24UIKit 0x362c572e - + 262
25CoreFoundation 0x35b63aec __NSArrayChunkIterate + 360
26CoreFoundation 0x35b5ca74 __NSArrayEnumerate + 608
27CoreFoundation 0x35abeb66 - + 58
28UIKit 0x3627e09e - + 114
29UIKit 0x36263ba2 - + 414
30UIKit 0x362c59c4 - + 644
31UIKit 0x362c572e - + 262
32CoreFoundation 0x35b63aec __NSArrayChunkIterate + 360
33CoreFoundation 0x35b5ca74 __NSArrayEnumerate + 608
34CoreFoundation 0x35abeb66 - + 58
35UIKit 0x3627e09e - + 114
36UIKit 0x362c64ae - + 430
37UIKit 0x3634ff32 - + 58
38UIKit 0x363edd88 - + 460
39UIKit 0x3630e2b0 - + 3616
40UIKit 0x3630d482 - + 42
41UIKit 0x3630d40c - + 64
42UIKit 0x3644317c __57-_block_invoke_0 + 100
43UIKit 0x362cb676 - + 214
44UIKit 0x362d4d20 - + 176
45CoreFoundation 0x35ab9034 _CFXNotificationPost + 1424
46Foundation 0x3721bd8c - + 68
47UIKit 0x36268c60 - + 292
48UIKit 0x362633d6 - + 2954
49UIKit 0x362626c8 - + 68
50UIKit 0x36262116 _UIApplicationHandleEvent + 6150
51GraphicsServices 0x318885a0 _PurpleEventCallback + 588
52GraphicsServices 0x318881ce PurpleEventCallback + 30
53CoreFoundation 0x35b3d170 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
54CoreFoundation 0x35b3d112 __CFRunLoopDoSource1 + 134
55CoreFoundation 0x35b3bf94 __CFRunLoopRun + 1380
56CoreFoundation 0x35aaeeb8 CFRunLoopRunSpecific + 352
57CoreFoundation 0x35aaed44 CFRunLoopRunInMode + 100
58GraphicsServices 0x318872e6 GSEventRunModal + 70
59UIKit 0x362b62f4 UIApplicationMain + 1116
</code></pre>
<p>既不涉及线程事件,也不自定义 ViewController。此外,我正在使用 ARC。</p>
<p>我想知道原因的确切原因或在发生自转时导致崩溃的可能性。</p>
<p>提前谢谢...</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>我认为应用程序会向已释放的对象发送消息。是的,即使您使用 ARC,有时也会发生这种情况。要调试它,您需要使用 Instruments (Zombies) 运行您的应用并尝试重现该错误。</p></p>
<p style="font-size: 20px;">关于ios - iOS中的自动旋转崩溃,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/16482650/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/16482650/
</a>
</p>
页:
[1]