Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

GregX999

macrumors newbie
Original poster
Apr 5, 2009
18
0
Ok, I'm hoping to get a few hints here to start me off in the right direction. I'm pretty new to Cocoa programming and am trying to wrap my head around the way xib files work and how my brain needs to think about them.

What I want to do is have an app that displays a "splash screen" when it first loads. This splash screen would have buttons to create a new document, load an existing document, edit settings or quit. (Only one document would ever be loaded at a time, if you load one when one is already open the open one goes away).

If you choose to load one, the load screen comes up and and you choose the file to load. If you choose to create a new one, another screen (sub-screen of the main menu) comes up so you can configure the initial settings.

New, Load and Settings would all be in the main application menu as well, but I wanted a quick way to see and click them too.

After a document is loaded or created, the splash screen would go away and the document screen will appear.

If you close the document screen, the splash screen will reappear.

If you close the splash screen (or press the quit button on the splash screen) the application quits.

The whole time the app is open, the main menu will be active at the top of the screen when the app is the active app. Since the settings window would always be available from the menu, it could be open along with either the splash screen or the document screen.

My questions:

1. So, should I start with a "Cocoa Application" or a "Cocoa Document Based Application"? I'm assuming the former.

2. Do I make the MainMenu.xib the splash screen or should I make a separate SplashScreen.xib?

3. I assume I should make a NewFile.xib, and NewFileController which would have to inherit from NSWindowController as it would be created by MainMenuController.

4. If the NewFileController creates the document window, how would that window close the splash screen, and how would the splash screen know to appear again if the document is closed?

5. Or... does it make sense to use the MainMenu to create and keep track of the document window and splash screen (and the settings screen) so that it can keep control over everything - with those other windows just reporting back to the MainMenuController when needed?

6. Perhaps I should think of the MainMenuController as an overall AppController - or create a separate AppController that I drag into the MainMenu.xib along with a MainMenuController?

I'm coming from a PHP and Ruby on Rails background so dealing with xibs is a bit confusing. I don't see an obvious "point of entry" when I create a new "Cocoa Application" - what loads the MainMenu.xib? Is it loaded first just because it's in the info.plist file under "Main nib file base name"? What if you don't want to load a xib first, but instead want to load an AppController first? Or would that be a stupid thing to do?

Thanks for any clarification you can offer!
Greg
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.