SIGABRT错误 - 将应用程序从xcode 3移植到xcode 4
问题描述:
我最近将iPhone应用程序从xcode 3移植到xcode 4,并且出现SIGABRT错误。我已经找到了问题的行(这是注释掉线 - >在我的应用程序委托执行):SIGABRT错误 - 将应用程序从xcode 3移植到xcode 4
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
// Set the view controller as the window's root view controller and display.
self.window.rootViewController = self.viewController;
//navigationController = [[UINavigationController alloc] initWithRootViewController:self.window.rootViewController];
navigationController.navigationBar.tintColor = [UIColor
colorWithRed:217.0/255
green:33.0/255
blue:0
alpha:1];
navigationController.navigationBarHidden = YES;
[self.window addSubview:navigationController.view];
[self.window makeKeyAndVisible];
return YES;
}
任何想法,为什么navigationController = [[UINavigationController alloc] initWithRootViewController:self.window.rootViewController];
导致问题?
编辑:编译器跳回主要方法并显示sigabrt错误。
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil); //jumps to this line
[pool release];
return retVal;
}
答
你有什么太大的意义。试试这个:
navigationController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
self.window.rootViewController = navigationController;
并删除行[self.window addSubview:navigationController.view];
。
它仍然无法正常工作 - 同样的错误 – user559142 2012-03-03 22:01:39
是否有任何记录? – edc1591 2012-03-03 22:39:19