Could not find a storyboard named 'MainStoryBoard' in bundle NSBundle

前端 未结 27 2575
感动是毒
感动是毒 2020-12-02 15:41

I have started a new app a few days ago and began working with the simulator to test it. I started as an empty project and manually added the storyboard. The simulator build

27条回答
  •  抹茶落季
    2020-12-02 16:08

    In my case, it was a storyboard inside a framework for a Mac application. I was using:

    let storyboard = NSStoryboard(name: "StoryboardName", bundle: nil)
    

    and needed to use the framework's bundle identifier to get the correct bundle:

    let storyboard = NSStoryboard(name: "StoryboardName",
                                bundle: Bundle(identifier: "com.company.FrameworkName"))
    

提交回复
热议问题