Re: Converting an existing Mac project to use storyboard
Re: Converting an existing Mac project to use storyboard
- Subject: Re: Converting an existing Mac project to use storyboard
- From: Roland King <email@hidden>
- Date: Tue, 02 Sep 2014 19:38:47 +0800
> On 2 Sep 2014, at 6:33 pm, Allison Newman <email@hidden> wrote:
>
> I’m trying to convert an existing project over to using storyboards on Yosemite, but I can’t get my main storyboard to load.
>
> What I’ve tried:
> Checking Apple documentation. The Apple documentation for storyboards on the Mac is close to non-existant at the moment, or at least I haven’t been able to find any.
> Googling. This turned up the suggestion that I set the Main storyboard based file name in my application’s info.plist. This was a suggestion coming from the world of iOS, but I tried anyhow, creating a storyboard called ‘Main.storyboard', and setting the base name in my info.plist to ‘Main’. Although this doesn’t break the project, when the application is run, the existing MainMenu.xib is loaded at startup.
> So then I tried removing the Main xib file base name property from my info.plist. Once this is done, the application runs, but nothing is shown - there are no menus available except for the application menu, which is empty if you try clicking on it. No window is shown. The application can only be quit by stopping it in Xcode. applicationDidFinishLaunching isn’t called on my app delegate.
>
>
> Of note, if I leave the Main xib base file name property in place, but change the value to a non-existant xib file, the application quits immediately on launch. It’s only if this property is completely removed from the plist that I get the application launched, but without an interface.
>
> So, I’m a bit stuck. Can anyone help?
>
What key did you put it under in the info.plist file? It should be under ‘NSMainStoryBoardFile’ and have the name ‘Main’ (clever OS knows to add the .storyboard).
Are you copying the Main.storyboard during the Copy Bundle Resources phase? Just having it added to the target should do that, but check .. and you did add it to the target, right?
The Window Controller for the main window needs to have ‘Is Initial Controller’ checked in IB as well, does it?
One thing you can do is make a test project from a template then go look at that and see how it’s set up, then copy. Remember great artists steal.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden