Since a few days I've been experiencing a very strange crash when debugging our app within Xcode 11.
We have an app built for iOS 11 and higher. But since Xcode 11 the app is crashing on setting the root view controller. But when I open the app after it crashed, the app does work so it seems it has something to do with setup a debug session.
The device where I try to build on is an iPhone Xs, with iOS 13.1.2. I also tried another device with 13.1 but having the same issue there.
However, when I attach a device that is running on 12.x.x it's working.
Strangely, yesterday I was able to run on a simulator. But since today the same crash occures on a device (iPhone Xs).
Also maybe important to mention: colleagues of me that work with the same project, do not have the same issues. (!!)
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Show app loading view controller
self.window = [[RMWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = [[AppLoadingViewController alloc] init]; // Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
[self.window makeKeyAndVisible];
UIViewController()
instead of AppLoadingViewController()
.This is an app that contains both Objective-C and Swift code, we have it already for years. But it's the first time that something like this is happening.
Is there anyone who has an idea of what this could be?
plist file → Application Scene Manifest property → Scene Configuration → item 0 and get rid of the property Storyboard Name by clicking the icon that has a minus in the circle next to it. ► Run the app and you will see the black screen and let's change that by setting a new root view controller.
The root view controller is simply the view controller that sits at the bottom of the navigation stack. You can access the navigation controller's array of view controllers through its viewControllers property. To access the root view controller, we ask for the first item of the array of view controllers.
let homeVC = UIStoryboard(name:"Main", bundle: nil).instantiateViewController(withIdentifier: "SigninViewController") as! SigninViewController
let navC = UINavigationController(rootViewController: homeVC)
navC.navigationBar.isHidden = true
UIApplication.shared.windows.first?.rootViewController = navC
UIApplication.shared.windows.first?.makeKeyAndVisible()
try this it is working Fine in my case..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With