성가신 충돌을 해결하는 데 문제가 있습니다. 정확하게 정확하게 재현하는 방법을 알 수는 없지만, 앱이 백그라운드에서 나간 후에야 만 발생합니다. 2 일마다 충돌이 발생합니다.백그라운드에서 레이어 애니메이션 중 iPhone이 깨졌습니다.
applicationDidBecomeActive :에서 나는 0.4 초마다 발생하는 타이머를 다시 시작합니다. 그것은 다음을 호출합니다 :
- (void)rotate {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.3];
self.transform = CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(-[LocationModel instance].heading.magneticHeading));
[UIView commitAnimations];
}
또한 RotateView의 경우 충돌 보고서에 표시되는 41 번째 줄의 본문 인 drawRect가 있습니다.
- (void)drawRect:(CGRect)rect {
[img drawInRect:rect]; // line 41
}
img는 imageNamed :가로드 된 작은 UII 이미지이며 ivar에 저장됩니다.
어떤 조언이 필요합니까? 나는 충돌 보고서에 대한 경험이 거의 없다.
감사합니다.
충돌 보고서 :
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x3001b482
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x333a6c98 objc_msgSend + 16
1 MyApp 0x000259bc -[RotateView drawRect:] (RotateView.m:41)
2 UIKit 0x34f4a9fe -[UIView(CALayerDelegate) drawLayer:inContext:] + 258
3 QuartzCore 0x3058efa6 -[CALayer drawInContext:] + 86
4 QuartzCore 0x3058ed24 _ZL16backing_callbackP9CGContextPv + 32
5 QuartzCore 0x3058e776 CABackingStoreUpdate + 1226
6 QuartzCore 0x3058e178 -[CALayer _display] + 724
7 QuartzCore 0x3058de86 -[CALayer display] + 134
8 QuartzCore 0x30582706 CALayerDisplayIfNeeded + 178
9 QuartzCore 0x305821c6 CA::Context::commit_transaction(CA::Transaction*) + 214
10 QuartzCore 0x30581fd0 CA::Transaction::commit() + 184
11 QuartzCore 0x30580900 CA::Transaction::pop() + 120
12 QuartzCore 0x3058087e +[CATransaction commit] + 22
13 UIKit 0x35096bcc _UIWindowUpdateVisibleContextOrder + 136
14 UIKit 0x35096c60 +[UIWindow _prepareWindowsForAppResume] + 4
15 UIKit 0x3508f3de -[UIApplication _handleApplicationResumeEvent:] + 66
16 UIKit 0x34f39e20 -[UIApplication handleEvent:withNewEvent:] + 2724
17 UIKit 0x34f3920e -[UIApplication sendEvent:] + 38
18 UIKit 0x34f38c4c _UIApplicationHandleEvent + 5084
19 GraphicsServices 0x35873e70 PurpleEventCallback + 660
20 GraphicsServices 0x35873efa PurpleEventSignalCallback + 10
21 CoreFoundation 0x36126a72 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 6
22 CoreFoundation 0x36128758 __CFRunLoopDoSources0 + 376
23 CoreFoundation 0x361294e4 __CFRunLoopRun + 224
24 CoreFoundation 0x360b9ebc CFRunLoopRunSpecific + 224
25 CoreFoundation 0x360b9dc4 CFRunLoopRunInMode + 52
26 GraphicsServices 0x35873418 GSEventRunModal + 108
27 GraphicsServices 0x358734c4 GSEventRun + 56
28 UIKit 0x34f63d62 -[UIApplication _run] + 398
29 UIKit 0x34f61800 UIApplicationMain + 664
30 MyApp 0x000026c4 main (main.m:14)
31 MyApp 0x0000266c start + 32
이미 활성화되어 있습니다. NSZombies가 충돌 로그에 무언가를 보여줄 것입니까? –
좀비를 사용하면 일반적으로 '할당 해제 된 인스턴스 0x80d7c00으로 보낸 메시지'와 같은 메시지가 표시되고 거기에서부터 진행됩니다. 악기를 사용해 볼 수도 있고, 좀비를 찾을 수있는 방법도 있습니다. – tassinari
나는이 도구들을 이해하고 있지만 위에서 언급했듯이 충돌은 드물게 발생합니다. 장치를 통해 디버그 할 수 없습니다. –