Re: Starting out with storyboards (on Mac)
Re: Starting out with storyboards (on Mac)
- Subject: Re: Starting out with storyboards (on Mac)
- From: email@hidden
- Date: Tue, 01 Mar 2016 18:56:29 +0900
In a non document based app template there is a window in MainMenu.nib hooked up and configured to display at launch.
There is a certain amount of seeming magic that happens when an app launches. It's better exposed in main.m in Objective-C where a function is called that kicks things off.
That process was well described in the now very out of date book Cocoa in a Nutshell.
You can always add a window in MainMenu anything there is loaded at launch.
Sent from my iPhone
> On Mar 1, 2016, at 6:33 PM, Daryle Walker <email@hidden> wrote:
>
> Apologies for this 101 question.
>
> Tried out Mac programming a couple of years ago, pre-Swift and when storyboards were about to come out for the Mac. I used XIBs back then. Forward to a couple months ago, and I tried out a Mac programming book. I started a new Xcode (7) default project (no docs, no Core Data) and turned on both Swift and storyboards. The app shows a window when I first run it. I’m thinking of being more formal and implement a New command.
>
> I guess I can use "+ storyboardWithName: bundle:” and "- instantiateControllerWithIdentifier:” to create a new window. But where does the default one come from? Why did it initiate? Is it because the window in the Main storyboard has the initial arrow on it? How can I turn off the current automatic window on app-open? (I’ll reimplement it with openUntitledFile.)
>
> I remember for my first project a few years ago that I had to have an array of NSWindow in my application delegate so each window keeps a reference around. How is the storyboard's window in the new default app staying around without an (obvious) reference? There are no properties keeping a window reference in the default code for the application delegate? Does this mean I now don’t have to keep references for windows either?
>
> ―
> Daryle Walker
> Mac, Internet, and Video Game Junkie
> darylew AT mac DOT com
>
> _______________________________________________
>
> 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
_______________________________________________
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