我有一个我正在制作的iPad应用程序,但它在启动时崩溃,即使没有错误或警告,输出除了“(lldb)”之外没有输出任何内容,它标记了一个指针。
这是构建后崩溃的图像。
以下是代码:
- (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;
}
我现在也注意到错误是在[self.window makeKeyAndVisible];
行给出的。
答案 0 :(得分:7)
您的代码看起来没问题,崩溃可能是由于抛出窗口的XIB文件引发的异常引起的......
在Interface Builder中查看Window,并尝试临时删除对View Controller中存在的任何IBOutlet的所有引用...