2014-02-12 148 views
0

每當我嘗試運行IOS模擬器,它總是崩潰。我使用Xcode 5.0.2。在main.m文件,它說
線程1:SIGABRT。 Heres是SIGABRT出現的路線。IOS模擬器總是崩潰?

return UIApplicationMain(argc, argv, nil, NSStringFromClass([xyzAppDelegate class])); 

繼承人發生了什麼事情在main.m文件

#import <UIKit/UIKit.h> 

#import "xyzAppDelegate.h" 

int main(int argc, char * argv[]) 
{ 
@autoreleasepool { 
    return UIApplicationMain(argc, argv, nil, NSStringFromClass([xyzAppDelegate class])); 
    } 
} 

xyzAppDelegate.h

#import <UIKit/UIKit.h> 

@interface xyzAppDelegate : UIResponder <UIApplicationDelegate> 

@property (strong, nonatomic) UIWindow *window; 

@end 

xyzAppDelegate.m

#import "xyzAppDelegate.h" 

@implementation xyzAppDelegate 

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:  (NSDictionary *)launchOptions 
{ 
      self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 
      self.window.backgroundColor = [UIColor whiteColor]; 
      [self.window makeKeyAndVisible]; 
      return YES; 
} 
- (void)applicationWillResignActive:(UIApplication *)application 
{ 
} 
- (void)applicationDidEnterBackground:(UIApplication *)application 
{ 
} 

- (void)applicationWillEnterForeground:(UIApplication *)application 
{ 
} 
- (void)applicationDidBecomeActive:(UIApplication *)application 
{ 

} 

- (void)applicationWillTerminate:(UIApplication *)application 
{ 
} 

@end 

下面是它顯示了調試區域

2014-02-13 00:06:47.933 ToDoList[707:70b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/garibaldi/Library/Application Support/iPhone Simulator/7.0.3/Applications/8B1ABBAB-D173-4A8E-80AC-8DEA44C5EDE8/ToDoList.app> (loaded)' with name 'Main'' 
*** First throw call stack: 
(
    0 CoreFoundation      0x0174c5e4 __exceptionPreprocess + 180 
    1 libobjc.A.dylib      0x014bb8b6 objc_exception_throw + 44 
    2 CoreFoundation      0x0174c3bb +[NSException raise:format:] + 139 
    3 UIKit        0x004ca39c -[UINib instantiateWithOwner:options:] + 951 
    4 UIKit        0x004cc2fb -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 165 
    5 UIKit        0x002293bb -[UIApplication _loadMainNibFileNamed:bundle:] + 58 
    6 UIKit        0x002296e9 -[UIApplication _loadMainInterfaceFile] + 245 
    7 UIKit        0x0022828f -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 543 
    8 UIKit        0x0023c87c -[UIApplication handleEvent:withNewEvent:] + 3447 
    9 UIKit        0x0023cde9 -[UIApplication sendEvent:] + 85 
    10 UIKit        0x0022a025 _UIApplicationHandleEvent + 736 
    11 GraphicsServices     0x036df2f6 _PurpleEventCallback + 776 
    12 GraphicsServices     0x036dee01 PurpleEventCallback + 46 
    13 CoreFoundation      0x016c7d65 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53 
    14 CoreFoundation      0x016c7a9b __CFRunLoopDoSource1 + 523 
    15 CoreFoundation      0x016f277c __CFRunLoopRun + 2156 
    16 CoreFoundation      0x016f1ac3 CFRunLoopRunSpecific + 467 
    17 CoreFoundation      0x016f18db CFRunLoopRunInMode + 123 
    18 UIKit        0x00227add -[UIApplication _run] + 840 
    19 UIKit        0x00229d3b UIApplicationMain + 1225 
    20 ToDoList       0x0000219d main + 141 
    21 libdyld.dylib      0x01d7670d start + 1 
) 
libc++abi.dylib: terminating with uncaught exception of type NSException 
(lldb) 

我嘗試下面的Apple首款教程。對不起,如果我不夠清楚,我在這裏還是新鮮的。

+0

原來的問題是我忘了寫.storyboard。在項目部署信息下的主界面中。 – theman

回答

1

嘗試重置模擬器。

對不起,我還不能上傳圖片,但:

(如果模擬器不運行)

  1. 在Xcode,去的XCode菜單(「文件」的一個左)頂部,'開發開發工具'>'iOS模擬器'。

  2. 在模擬器,點擊「iPhone模擬器菜單」>上的休息內容和設置...'

0

嘗試重置模擬器(如@ bauerMusic的答案)然後重啓你的Mac。這一貫地解決了我所遇到的類似問題。