设置CALayer转换属性会导致崩溃

时间:2018-10-03 09:01:33

标签: ios swift core-animation

我正在构建交互式旋转光盘控件。当用户拖动视图时,我将旋转变换应用于视图。像这样:

circleView.layer.transform = CATransform3DMakeRotation(angle, 0, 0, 1)

由于某种原因,此行代码导致应用崩溃。崩溃不是在该行的第一击发生,而是在 连续旋转几秒钟。如果我将这一行注释掉,则不会发生崩溃。

更糟糕的是,当应用崩溃时,xcode不会显示任何错误或堆栈跟踪信息,但会显示“与设备的连接丢失”。

这仅在设备上发生。在模拟器上一切正常。

在设备的崩溃日志中,崩溃时我没有看到我的应用程序崩溃,但是进程DTServiceHub崩溃了

Incident Identifier: 02336F7A-CAB3-4B13-9509-65EA61813529
CrashReporter Key:   e16756d8ab2514bab0584705f4151434dbed594f
Hardware Model:      iPad3,4
Process:             DTServiceHub [768]
Path:                /Developer/Library/PrivateFrameworks/DVTInstrumentsFoundation.framework/DTServiceHub
Identifier:          DTServiceHub
Version:             ???
Code Type:           ARM (Native)
Role:                Unspecified
Parent Process:      launchd [1]
Coalition:           <none> [352]


Date/Time:           2018-10-02 18:26:03.0352 +0300
Launch Time:         2018-10-02 18:25:45.0000 +0300
OS Version:          iPhone OS 10.3.3 (14G60)
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0bd5f30c
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]


hread 6 name:  Dispatch queue: NStatManager queue
Thread 6 Crashed:
0   libobjc.A.dylib                 0x1d404dc6 objc_msgSend + 6
1   CoreFoundation                  0x1e086210 -[__NSDictionaryM objectForKey:] + 128
2   IDEDebugGaugeDataProviders      0x00439278 0x430000 + 37496
3   IDEDebugGaugeDataProviders      0x004382a8 0x430000 + 33448
4   NetworkStatistics               0x240ab374 -[NWStatisticsDelegateBlockWrapper sourceDidReceiveCounts:] + 160
5   NetworkStatistics               0x240a548c __59-[NWStatisticsManager dispatchDidReceiveCounts:fromUpdate:]_block_invoke + 110
6   libdispatch.dylib               0x1d83d796 _dispatch_call_block_and_release + 10
7   libdispatch.dylib               0x1d84a59c _dispatch_queue_serial_drain + 854
8   libdispatch.dylib               0x1d840b70 _dispatch_queue_invoke + 886
9   libdispatch.dylib               0x1d84c1b4 _dispatch_root_queue_drain + 326
10  libdispatch.dylib               0x1d84c00e _dispatch_worker_thread3 + 106
11  libsystem_pthread.dylib         0x1d9f287c _pthread_wqthread + 1040
12  libsystem_pthread.dylib         0x1d9f245c start_wqthread + 8

有什么想法吗?

0 个答案:

没有答案