简体   繁体   English

如何清除“无​​法实例化默认视图控制器”警告?

[英]How to remove “Failed to instantiate the default view controller” warning?

Within my storyboard I don't have any VC with the Is Initial View Controller checked as I am instantiating and setting the window.rootViewController programmatically within the app delegate. 在我的情节提要板中,我在应用程序委托中以编程方式实例化和设置window.rootViewController时,没有选中“初始视图控制器”的任何VC。

My app is working perfectly however I want to remove the "Failed to instantiate the default view controller" message. 我的应用程序运行正常,但是我想删除“无法实例化默认视图控制器”消息。

I found question regarding this on SO and the accepted answer stated that the warning will go away if the Main Storyboard File Base Name is removed from the info.plist ( Programmatically set the initial view controller using Storyboards ). 我在SO上发现了与此有关的问题,并且可接受的答案表明,如果从info.plist中删除了主Storyboard文件库名称,则警告将消失( 使用Storyboards通过编程设置初始视图控制器 )。

However my app does not have the Main Storyboard File Base Name entry in the info.plist, so is there something else I can do to remove this warning? 但是,我的应用程序在info.plist中没有Main Storyboard File Base Name条目,因此我还可以采取其他措施来删除此警告吗?

This is a similar question. 这是一个类似的问题。 Here the answers worked perfectly for me. 在这里,答案对我来说是完美的。 Please check it out. 请检查一下。 iOS 7 - Failing to instantiate default view controller iOS 7-无法实例化默认视图控制器

Select a random VC in your storyboard as the initial VC. 在情节提要中选择一个随机VC作为初始VC。 This will cause the warning to go away and the option will be overridden by your code inn AppDelegate. 这将导致警告消失,该选项将被您的代码客栈AppDelegate覆盖。 This is the approach I use to remove the warning. 这是我用来删除警告的方法。 Maybe more of a workaround, but it is simple and works great :-) 也许更多的解决方法,但是它很简单并且效果很好:-)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法实例化UIMainStoryboardFile'Main'的默认视图控制器 - Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' 从 .xcodeproj 切换到 .xcworkspace 后无法实例化默认视图控制器 - Failed to instantiate the default view controller after switching from .xcodeproj to .xcworkspace 无法实例化默认视图控制器? - cannot instantiate default view controller? 未能为 UIMainStoryboardFile 'Main' 实例化默认视图 controller - 也许未设置指定的入口点? - Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set? 无法为 UIMainStoryboardFile 'Main' 实例化默认视图 controller - 也许未设置指定的入口点? - Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set? 无法实例化视图控制器。 - 斯威夫特 - Failed to instantiate view controller. - Swift 如何以编程方式实例化新的视图控制器 - How to instantiate a new view controller programmatically 无法实例化View Controller - Unable to Instantiate View Controller 如何从另一个视图控制器实例化导航控制器? - How to instantiate a navigation controller from another view controller? 如何使用制表符和导航控制器实例化视图控制器以进行深层链接? - How to instantiate a view controller with tab and nav controller for deep linking?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM