IOS模拟器不断崩溃?

时间:2014-02-12 17:24:02

标签: xcode

每当我尝试运行IOS模拟器时,它都会一直崩溃。我在Xcode 5.0.2上工作。在main.m文件中,它表示
线程1:SIGABRT。 Heres是SIGABRT出现的地方。

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的第一个教程。对不起,如果我不够清楚,我还是有点新人。

2 个答案:

答案 0 :(得分:1)

尝试重置模拟器。

对不起,我还无法上传图片,但是:

(如果模拟器未运行)

  1. 在XCode中,转到顶部的XCode菜单(“文件”左侧),“打开开发者工具”&gt; 'iOS模拟器'。

  2. 在模拟器中,点击“iOS模拟器菜单”&gt; '休息内容和设置......'

答案 1 :(得分:0)

尝试重置模拟器(如在@ bauerMusic的回答中),然后重启Mac。这始终解决了我遇到的类似问题。