我们的iPad应用程序用户中有一小部分但很大比例因我们无法在我们的模拟器或任何设备上复制的错误而崩溃。不确定这是否有所不同,但我们已经与一些用户讨论了这个问题并且他们都在使用iPad 4。
关于如何修复它而不能复制它的任何想法?
这是日志:
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x0000000000000020
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x00000001955540b8 objc_retain + 24
1 AppName 0x00000001000a6214 -[EDSSpeechButton initWithFrame:] (EDSSpeechButton.m:29)
2 AppName 0x00000001000a1670 -[EDSLandPageScenarioViewController viewWillAppear:] (EDSLandPageScenarioViewController.m:68)
3 UIKit 0x000000018bb440c0 -[UIViewController _setViewAppearState:isAnimating:] + 452
4 UIKit 0x000000018bcd9938 -[UINavigationController _startCustomTransition:] + 912
5 UIKit 0x000000018bbe3f54 -[UINavigationController _startDeferredTransitionIfNeeded:] + 464
6 UIKit 0x000000018bbe3d24 -[UINavigationController __viewWillLayoutSubviews] + 56
7 UIKit 0x000000018bbe3ca4 -[UILayoutContainerView layoutSubviews] + 200
8 UIKit 0x000000018bb26ff8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 348
9 QuartzCore 0x000000018b718258 -[CALayer layoutSublayers] + 184
10 QuartzCore 0x000000018b712e20 CA::Layer::layout_if_needed(CA::Transaction*) + 300
11 QuartzCore 0x000000018b712cd8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
12 QuartzCore 0x000000018b712560 CA::Context::commit_transaction(CA::Transaction*) + 280
13 QuartzCore 0x000000018b712304 CA::Transaction::commit() + 424
14 UIKit 0x000000018bb2b16c _UIApplicationHandleEventQueue + 9800
15 CoreFoundation 0x0000000188b23044 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
16 CoreFoundation 0x0000000188b223a0 __CFRunLoopDoSources0 + 256
17 CoreFoundation 0x0000000188b20638 __CFRunLoopRun + 632
18 CoreFoundation 0x0000000188a616d0 CFRunLoopRunSpecific + 452
19 GraphicsServices 0x000000018e6fdc0c GSEventRunModal + 168
20 UIKit 0x000000018bb92fdc UIApplicationMain + 1156
21 AppName 0x000000010009a3d0 main (main.m:16)
22 libdyld.dylib 0x0000000195b2faa0 start + 4
以下是initWithFrame
:
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.synthesizer = [[AVSpeechSynthesizer alloc] init];
self.synthesizer.delegate = self;
speechPaused = NO;
self.button = [UIButton buttonWithType:UIButtonTypeCustom];
self.button.frame = CGRectMake(0, 0, 64, 64);
self.button.backgroundColor = [UIColor clearColor];
self.button.hidden = YES;
[self.button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal ];
[self.button addTarget:self action:@selector(playPauseButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
[self.button setBackgroundImage:[UIImage imageNamed:@"voiceClipIcon"] forState:UIControlStateNormal];
[self addSubview:self.button];
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
NSString *hasAudio = [prefs objectForKey:@"hasAudio"];
if([hasAudio isEqualToString:@"1"] && IS_IOS7==YES)
{
self.button.hidden = NO;
}
}
return self;
}
编辑:以下是发生崩溃的地方:
EDSSpeechButton.m line 29
-[EDSSpeechButton initWithFrame:]
第29行:self.button.frame = CGRectMake(0, 0, 64, 64);
更新:与更多用户交谈后,似乎崩溃与第4代iPad隔离。