2013-05-01 67 views
6

我通常不会要问SO,以便了解我的崩溃报告,但(一)我可以学到很多关于阅读从这里专家崩溃报告,和(b),我认识到,我不太了解导航流程,正如我所希望的(这部分特定于我认为的下面的崩溃报告)。iOS版 - 崩溃在loadViewIfRequired

所以我希望有人已经遇到了同样的问题,可以帮助我了解为什么我的应用程序崩溃。

它只崩溃有时,这是超越我,为什么它是间歇性的。但是,当它崩溃时,它会在同一个地方崩溃,并具有相同的堆栈跟踪(如下所示)。

现在我看到它在cmdPressed崩溃(有很多代码在此方法),但它是我很难明白什么比这更深。

从阅读下面的崩溃报告,没有任何人有任何意见,为什么我的应用程序崩溃???为什么它可能不一致?

Thread 0 Crashed: 
0 libobjc.A.dylib      0x344dd5aa _objc_msgSend + 10 
1 UIKit        0x3374458d -[UIViewController loadViewIfRequired] + 365 
2 UIKit        0x33799133 -[UIViewController contentScrollView] + 27 
3 UIKit        0x33799079 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 29 
4 UIKit        0x33798f5d -[UINavigationController _layoutViewController:] + 33 
5 UIKit        0x33798e81 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 273 
6 UIKit        0x337985c1 -[UINavigationController _startTransition:fromViewController:toViewController:] + 65 
7 UIKit        0x337984a9 -[UINavigationController _startDeferredTransitionIfNeeded:] + 325 
8 UIKit        0x337e54b1 -[UINavigationController defaultFirstResponder] + 129 
9 UIKit        0x33797849 -[UIResponder(Internal) _deepestDefaultFirstResponder] + 25 
10 UIKit        0x337976fb -[UIResponder(Internal) _promoteDeepestDefaultFirstResponder] + 31 
11 UIKit        0x33813349 -[UIWindowController transitionViewDidStart:] + 81 
12 UIKit        0x337bf8db -[UITransitionView transition:fromView:toView:removeFromView:] + 991 
13 UIKit        0x33a00059 __91-[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:]_block_invoke_0236 + 389 
14 UIKit        0x33812961 -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:] + 4761 
15 UIKit        0x33810fc7 -[UIViewController presentViewController:withTransition:completion:] + 3395 
16 UIKit        0x33933257 -[UIViewController presentModalViewController:animated:] + 31 
17 MyApp        0x00044973 -[AppViewController cmdPressed] (AppViewController.mm:553) 
18 UIKit        0x338100a5 -[UIApplication sendAction:to:from:forEvent:] + 73 
19 UIKit        0x33810057 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 31 
20 UIKit        0x33810035 -[UIControl sendAction:to:forEvent:] + 45 
21 UIKit        0x3380f8eb -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 503 
22 UIKit        0x3380fde1 -[UIControl touchesEnded:withEvent:] + 489 
23 UIKit        0x337385f1 -[UIWindow _sendTouchesForEvent:] + 525 
24 UIKit        0x33725801 -[UIApplication sendEvent:] + 381 
25 UIKit        0x3372511b _UIApplicationHandleEvent + 6155 
26 GraphicsServices     0x389085a3 _PurpleEventCallback + 591 
27 GraphicsServices     0x389081d3 PurpleEventCallback + 35 
28 CoreFoundation      0x3a5c8173 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 35 
29 CoreFoundation      0x3a5c8117 __CFRunLoopDoSource1 + 139 
30 CoreFoundation      0x3a5c6f99 __CFRunLoopRun + 1385 
31 CoreFoundation      0x3a539ebd _CFRunLoopRunSpecific + 357 
32 CoreFoundation      0x3a539d49 _CFRunLoopRunInMode + 105 
33 GraphicsServices     0x389072eb _GSEventRunModal + 75 
34 UIKit        0x337792f9 _UIApplicationMain + 1121 
35 MyApp        0x0003d083 main (main.m:44) 

任何意见是极大的赞赏。谢谢!!!

+0

objc_msgSend的崩溃通常是由于内存管理问题。尝试重现崩溃,而using the Zombies instrument,看看是否给你更多的信息。 – 2013-05-01 19:18:47

+0

它在presentModalViewController中崩溃,所以你可能会发送一些不好的东西。您应该发布您收到的错误消息,因为从您在此处显示的内容中无法看到更深的内容。 – 2013-05-01 18:50:55

+0

请从'AppViewController'发布代码 – Nick 2015-01-26 22:17:38

回答

-3

尝试添加此方法。希望这会帮助你。

-(void)setView:(UIView*)view 
{ 
    if(view != nil) 
[super setView:view]; 
    else 

     NSLog(@"Memory"); 
} 
0

我知道这是晚了,我也不知道这是否会解决您的问题。但是当我遇到这个问题(与loadViewIfRequired有关)并且挣扎了很多,因为在我的情况下,它有时只是崩溃。我从我的tableview控制器类的外部调用[UITableViewController tableView],这是在加载tableview之前调用的。由于我的tableView没有正确加载,所以我的UITableViewController类试图调用loadViewIfRequired API,并且在其他线程(不在主线程中)调用ViewDidLoad。 我通过获取加载还我装在主线程其中固定我的问题不是要求[UITableViewController中的tableView]这个我tableviewcontroller之前解决了这个问题。

0

我面临同样的问题。对我而言,问题在于我更改了xib文件,但忘记连接所有以前的插座。