After deleting Main.storyboard, an error is reported and a black screen is reported. Could not find a storyboard named'Main' in bundle NSBundle

Because of the different post-processing methods of iOS13.

After deleting the main.storyboard in the project, delete the corresponding key value in the plist file, as well as delete others. details as follows

1. Delete the corresponding key value in the plist file

2. Delete Application Scene manifest. After this is iOS13, there is an additional SceneDelegate based on the previous AppDelegate, which will transfer the lifecycle proxy methods in the AppDelegate to the SceneDelegate

 

3. Comment out the two methods configurationForConnectingSceneSession and didDiscardSceneSessions in appdelegat.m.

According to Apple’s official documentation, the general meaning is that a UISceneSession does not require you to create objects directly. You can use the requestSceneSessionActivation:userActivity:options:errorHandler: method in UIApplication. This method will help you initialize a default configuration based on the info.plist file. The session object.

Therefore, if you want to implement your own project without default main.storyboard in xcode11, you have to transfer the lifecycle in SceneDelegate to AppDelegate. According to the above, this step is to delete or comment the two methods in the screenshot (quoted from the author : Harllan_he link: https://www.jianshu.com/p/e255303d11b8)

4. The code initializes your window. After deleting main.storyboard, you need to initialize a window in AppDelegate.m for use, otherwise the application has no window available.

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[self.window makeKeyAndVisible]

Guess you like

Origin blog.csdn.net/ximiaoweilai/article/details/108668586