在视图控制器之间切换时出现崩溃错误

时间:2013-10-28 01:58:07

标签: ios iphone storyboard

我在viewcontrollers之间切换时遇到错误。使用故事板通过segues进行切换。有趣的是,如果我从ViewController A切换到B并快速返回,一切正常。如果我从ViewController A切换到B然后等待20秒,然后尝试切换回ViewController我的应用程序崩溃时出现此错误:

  

' NSInternalInconsistencyException',原因:'无法加载NIB   捆绑:' NSBundle   (加载)'名字' 2-view-3'和目录   ' MainStoryboard_iPhone.storyboardc''

要添加两件事 1.我使用没有笔尖或xib文件的故事板 2.我有一个MainStoryboard_iPhone.storyboard文件(在错误消息中读取时没有' c')。

任何帮助表示赞赏。这是完整的错误输出:

> *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in
> bundle: 'NSBundle </Users/myname/Library/Application Support/iPhone
> Simulator/7.0.3/Applications/73FBEFE1-C31E-499C-9084-2B8B284EA5E7/myapp.app>
> (loaded)' with name 'Bkf-UI-YhZ-view-Nrc-eq-8MI' and directory
> 'MainStoryboard_iPhone.storyboardc''
> *** First throw call stack: (     0   CoreFoundation                      0x024135e4 __exceptionPreprocess + 180  1   libobjc.A.dylib           
> 0x01bf68b6 objc_exception_throw + 44  2   CoreFoundation              
> 0x024133bb +[NSException raise:format:] + 139     3   UIKit              
> 0x009f839c -[UINib instantiateWithOwner:options:] + 951   4   UIKit    
> 0x0086a605 -[UIViewController _loadViewFromNibNamed:bundle:] + 280    5 
> UIKit                               0x0086adad -[UIViewController
> loadView] + 302   6   UIKit                               0x0086b0ae
> -[UIViewController loadViewIfRequired] + 78   7   UIKit                               0x0086b5b4 -[UIViewController view] + 35    8   UIKit                   
> 0x0087a361 -[UIViewController viewControllerForRotation] + 63     9  
> UIKit                               0x00871f00 -[UIViewController
> _visibleView] + 84    10  UIKit                               0x0087b2f0 -[UIViewController rotatingContentViewForWindow:] + 33   11  UIKit                               0x00bbfa03 -[UIClientRotationContext
> initWithClient:toOrientation:duration:andWindow:] + 327   12  UIKit    
> 0x0079b2f2 -[UIWindow
> _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:]
> + 1495    13  UIKit                               0x00aff7b9 -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:animation:]
> + 2798    14  UIKit                               0x008770fc -[UIViewController presentViewController:withTransition:completion:] + 6433  15  UIKit                               0x0087761f
> -[UIViewController presentViewController:animated:completion:] + 130  16  UIKit                               0x0087765f -[UIViewController
> presentModalViewController:animated:] + 56    17  UIKit                 
> 0x00c9be16 -[UIStoryboardModalSegue perform] + 271    18  UIKit         
> 0x00c8c07e -[UIStoryboardSegueTemplate _perform:] + 174   19  UIKit    
> 0x00c8c0f9 -[UIStoryboardSegueTemplate perform:] + 115    20 
> libobjc.A.dylib                     0x01c08874 -[NSObject
> performSelector:withObject:withObject:] + 77  21  UIKit               
> 0x007590c2 -[UIApplication sendAction:to:from:forEvent:] + 108    22 
> UIKit                               0x00a2dc9b
> -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 139   23  libobjc.A.dylib                     0x01c08874 -[NSObject
> performSelector:withObject:withObject:] + 77  24  UIKit               
> 0x007590c2 -[UIApplication sendAction:to:from:forEvent:] + 108    25 
> UIKit                               0x0075904e -[UIApplication
> sendAction:toTarget:fromSender:forEvent:] + 61    26  UIKit             
> 0x008510c1 -[UIControl sendAction:to:forEvent:] + 66  27  UIKit       
> 0x00851484 -[UIControl _sendActionsForEvents:withEvent:] + 577    28 
> UIKit                               0x00850733 -[UIControl
> touchesEnded:withEvent:] + 641    29  UIKit                             
> 0x0079651d -[UIWindow _sendTouchesForEvent:] + 852    30  UIKit         
> 0x00797184 -[UIWindow sendEvent:] + 1232  31  UIKit                   
> 0x0076ae86 -[UIApplication sendEvent:] + 242  32  UIKit               
> 0x0075518f _UIApplicationHandleEventQueue + 11421     33  CoreFoundation 
> 0x0239c83f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
> + 15  34  CoreFoundation                      0x0239c1cb __CFRunLoopDoSources0 + 235  35  CoreFoundation                      0x023b929e __CFRunLoopRun + 910     36  CoreFoundation                   
> 0x023b8ac3 CFRunLoopRunSpecific + 467     37  CoreFoundation             
> 0x023b88db CFRunLoopRunInMode + 123   38  GraphicsServices             
> 0x031f79e2 GSEventRunModal + 192  39  GraphicsServices                
> 0x031f7809 GSEventRun + 104   40  UIKit                              
> 0x00757d3b UIApplicationMain + 1225   41  myapp                 
> 0x0000298d main + 141     42  libdyld.dylib                      
> 0x03ddb70d start + 1 ) libc++abi.dylib: terminating with uncaught
> exception of type NSException

1 个答案:

答案 0 :(得分:0)

请确保您在以下方法中加载任何与self.tableView相关的视图相关内容。这会导致不一致。

-(id)initWithCoder:(NSCoder *)aDecoder