Thread 1: EXC_BREAKPOINT (code=EXC_i386_BPT, subcode=0x0) error

一世执手 提交于 2020-01-12 14:20:13

问题


I have an iPad app I am making, but it crashes on startup even though there are no errors or warnings, the output doesn't output anything besides "(lldb)", and it marks a pointer.

This is the image of the post build crash.

And here is the code:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
   /* UIImage *myImage = [UIImage imageNamed:@"de_dust2.png"];
    myImageView = [[UIImageView alloc] initWithImage:myImage];

    myScrollView.contentSize = CGSizeMake(myImageView.frame.size.width, myImageView.frame.size.height);
    myScrollView.maximumZoomScale = 4.0;
    myScrollView.minimumZoomScale = 0.75;
    myScrollView.clipsToBounds = YES;
    myScrollView.delegate = self;
   // [myScrollView addSubview:myImageView];*/

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    [self.viewController setRed:1];
     [self.viewController setGreen:0];
    [self.viewController setBlue:0];
    [self.viewController setAlpha:1];
    [self.viewController checkRotation];
    return YES;
}

I now also noticed that the error was given at the [self.window makeKeyAndVisible]; line.


回答1:


Your code looks ok, the crash could be caused by some exception thrown parsing the XIB file of the window ...

Take a look at the Window in Interface Builder and try to temporary remove all reference to any IBOutlet present in the View Controller ...



来源:https://stackoverflow.com/questions/13525677/thread-1-exc-breakpoint-code-exc-i386-bpt-subcode-0x0-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!