我在 Crashlytics 中遇到如下所示的崩溃。
我无法理解这是在应用程序中形成的。不幸的是,我自己从来没有能够产生这个崩溃,但它正在发生在野外。
应用程序名称只有一个引用,没有任何内容可以显示应用程序名称的来源。
是否没有关于应用程序中发生这种情况的数据的事实,是否表明在 didFinishLaunchingWithOptions 期间发生了问题,因此实际上还没有足够远来显示任何进一步的细节?还是有其他原因导致日志缺少数据来显示问题所在?
谁能告诉我如何能够追踪到这个?
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x0000000195de3bd0 objc_msgSend + 16
1 CoreFoundation 0x0000000183fd9458 CFRelease + 524
2 CoreFoundation 0x0000000183fe5a18 -[__NSArrayM dealloc] + 152
3 libobjc.A.dylib 0x0000000195de9724 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 564
4 CoreFoundation 0x0000000183fdd074 _CFAutoreleasePoolPop + 28
5 Foundation 0x0000000184f0e588 -[NSAutoreleasePool release] + 148
6 UIKit 0x0000000188be03f4 -[UIApplication _run] + 588
7 UIKit 0x0000000188bdaf40 UIApplicationMain + 1488
8 _THE_APP_NAME_ 0x0000000100031e20 main (main.m:16)
9 libdyld.dylib 0x000000019647aa08 start + 4
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x00000000f5b2beb8
我正在添加以下与此线程上的评论相关的内容。这段代码是与 UI 相关的主要更改,除了通常的标签设置等,我看不出有什么问题。
下面的代码已添加到 AppDelegate.m,DidFinishLaunchingWithOptions。
我想知道,因为崩溃不是我能够重现的东西,而且每天发生的情况只是在少数情况下,如果它可能是时间问题,并且 UI 无法接收消息。
我欢迎任何想法,如果您同意,我是否应该将代码移至 ViewController 中的 ViewDidLoad。
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor lightGrayColor], NSForegroundColorAttributeName,
[UIFont fontWithName:@"Helvetica Neue" size:16],
NSFontAttributeName, nil] forState:UIControlStateNormal];
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor darkGrayColor], NSForegroundColorAttributeName,
[UIFont fontWithName:@"Helvetica Neue" size:16],
NSFontAttributeName,
nil] forState:UIControlStateSelected];
[[UITabBar appearance] setBarTintColor:[UIColor colorWithRed:0.44 green:0.99 blue:0.45 alpha:1]];
[[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:0.44 green:0.99 blue:0.45 alpha:1]];
[[UINavigationBar appearance] setTintColor:[UIColor darkGrayColor]];
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor darkGrayColor], NSFontAttributeName : [UIFont fontWithName:@"Helvetica Neue" size:22]}];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];