Reputation: 71852
I am following this awesome tutorial but I didn't download the starter project because I want to create a different app. I have done everything where I want to pop up only CenterViewController
with Left side ViewController
. Both are in ContainerViewController
. But I get this in my console:
2014-11-19 14:04:46.838 SlideTable[3612:87749] Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set?
I also tried this answer but I got the same result.
What does this error mean? I have done all of the required things as the author provided at start up project but I didn't find any solution for this.
This is the code for my project:
AppDelegate.swift
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
window = UIWindow(frame: UIScreen.mainScreen().bounds)
let containerViewController = ContainerViewController()
window!.rootViewController = containerViewController
window!.makeKeyAndVisible()
return true
}
Am I missing something? I will provide further information if needed.
Upvotes: 9
Views: 16159
Reputation: 11
If you using the Navigation controller, then you have to give it an Initial View Controller check.
Today I faced this error but I tried this and it worked.
Upvotes: 1
Reputation: 1271
This is a trip down memory lane (iOS 12) for me, but it the error seems to be complaining about a storyboard file, while you do not seem to be using a storyboard at all! The AppDelegate programmatically instantiates the ContainerViewController instead. If this is the case you should remove the value for UIKit Main Storyboard File Base Name
in the build settings and mark the App Delegate class as your main entry point:
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
...
Upvotes: 1
Reputation: 548
Update for Xcode 11, and iOS 13.
In addition to elia's answer, you have to change one more attribute in Info.plist file.
In Info.plist file it is needed to change String value for Storyboard Name to the name of your initial file that you want to first appear during launching of the application.
By default value for Storyboard Name is set to "Main", and you need to change it.
You can find that attribute in:
Info.plist -> Application Scene Manifest -> Scene Configuration -> Application Session Role -> Item 0 -> Storyboard Name
Upvotes: 7
Reputation: 21
There exists a compatibility issue between IOS 12 and IOS 13. So you have to remove the Application Scene Manifest from the info.plist in order for it to function correctly. Also, you have to remove everything related to scenes from the App Delegate.
Upvotes: 2
Reputation: 1710
When you use more than one UIStoryboard
and want to init your UIViewController
except the Main.storyboard
for example Intro.storyboard
, then you would probably get this error. You must select
YourProject -> TARGETS -> Deployment Info -> Main Interface
In Main Interface
, there are several UIStoryboard
that you created for your own project. Choose the right one which contains your UIViewController
.
I mean
YourProject -> TARGETS -> General -> Deployment Info -> Main Interface.
Not YourProject -> TARGETS -> Deployment Info -> Main Interface.
Upvotes: 3
Reputation: 301
I have met the same issue and I found the solution:
This operation works well for me according to the same error message.
Upvotes: 18
Reputation: 191
The main controller of you app (the entry point), does it have the the "Is Initial View Controller" checked on the right bar? It will show an arrow next to it.
Upvotes: 7