我的应用程序存在很大问题,我已经使用Xcode 7 GM将其更新到iOS 9,并且我已经使用我的所有设备对其进行了测试,没有错误或崩溃。 我已经提交到App Store但我的所有用户都报告说,当他们打开应用程序时,立即崩溃,我已经检查了我与QuincyKit的崩溃日志,并说出:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application windows are expected to have a root view controller at the end of application launch'
我检查过所有内容,我发现在iOS中所有UIWindow
都必须设置rootViewController
,所以我已经检查了所有项目,并且发现我有第三方库:WTStatusBar
没有设置rootviewcontroller
,所以我做了这个修复:
UIViewController* vc = [[UIViewController alloc]initWithNibName:nil bundle:nil];
self.rootViewController = vc;
解决方法,然后我这样做:
NSArray *windows = [[UIApplication sharedApplication] windows];
for(UIWindow *window in windows) {
NSLog(@"window: %@",window.description);
if(window.rootViewController == nil){
UIViewController* vc = [[UIViewController alloc]initWithNibName:nil bundle:nil];
window.rootViewController = vc;
}
}
检查是否有一些UIWindow
未设置,现在我还没有将更新提交给apple,我要求加急审核,他们给我,更新在商店,应用程序仍然崩溃,这个错误让我疯狂,因为我没有在Xcode,应用程序永远不会撞到我,有一种方法可以在Xcode上找到它?所以我可以看到错误在哪里?我也有.Crashlog文件,但当我尝试将其符号化时,终端会给我这个:
atos cannot load symbols for the file MyApp for architecture armv7s.
任何人都可以帮助我吗?
编辑回应菲利普评论:
在我的application:didFinishLaunchingWithOptions:
我这样做:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[BWQuincyManager sharedQuincyManager] setSubmissionURL:@"myserver"];
[[BWQuincyManager sharedQuincyManager] startManager];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"FirstStart"] boolValue]) {
WelcomeViewController_iPhone *welcome;
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
welcome = [[WelcomeViewController_iPhone alloc] initWithNibName:@"WelcomeViewController_iPhone" bundle:nil];
} else {
welcome = [[WelcomeViewController_iPhone alloc] initWithNibName:@"WelcomeViewController_iPad" bundle:nil];
}
[self.window setRootViewController:welcome];
[self.window makeKeyAndVisible];
return YES;
}
[self initiateAllViewWithFlag:NO];
return YES;
}
- (void)initiateAllViewWithFlag:(BOOL)firstStart
{
...
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.tabBarController = [[AKTabBarController alloc] initWithTabBarHeight:49 position:AKTabBarPositionBottom];
...
} else {
self.tabBarController = [[AKTabBarController alloc] initWithTabBarHeight:63 position:AKTabBarPositionLeft];
...
}
[self.window setRootViewController:self.tabBarController];
[self.window makeKeyAndVisible];
if (!firstStart) {
[MTZWhatsNew handleWhatsNew:^(NSDictionary *whatsNew) {
// Creating the view controller with features.
MTZWhatsNewGridViewController *vc = [[MTZWhatsNewGridViewController alloc] initWithFeatures:whatsNew];
// Presenting the what's new view controller.
[self.window.rootViewController presentViewController:vc animated:NO completion:nil];
}];
} else {
[MTZWhatsNew setLastAppVersion:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]];
}
}