xcode - IOS模拟器老是崩溃?

标签 xcode

每当我尝试运行 IOS 模拟器时,它总是崩溃。我使用 Xcode 5.0.2。在 main.m 文件上它说
线程 1:SIGABRT。这是 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 的第一个教程。抱歉,如果我不够清楚,我还是个新来的。

最佳答案

尝试重置模拟器。

很抱歉,我还无法上传图片,但是:

(如果模拟器未运行)

  1. 在 XCode 中,转到顶部的 XCode 菜单("file"左侧),“打开开发人员工具”>“iOS 模拟器”。

  2. 在模拟器中,点击“iOS 模拟器菜单”>“其余内容和设置...”

关于xcode - IOS模拟器老是崩溃?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21735062/

相关文章:

java - bash 脚本错误 "exit code 126"

ios - Swift - 生成不在检索列表中的随机数

Xcode 错误 : failed to launch

ios - 将 Interface Builder 用于 Switch

xcode - 为 RxSwift 编写单元测试

ios - 如何在 TableViewcell 中为 Swift 保存 Firebase key

ios - 当应用程序的语言是阿拉伯语时,日期转换为阿拉伯数字

swift - XCode 10 向按钮添加 Action

ios - XCode IOS Apple LLVM 3.1 - Eigen NEON 中断

ios - 为什么使用 Storyboard在 UIScrollView 中不显示内容