Re: Cocoa Design Question ..
Re: Cocoa Design Question ..
- Subject: Re: Cocoa Design Question ..
- From: "Carlos A. Weber" <email@hidden>
- Date: Thu, 13 Jun 2002 07:41:46 -1000
On Thursday, Jun 13, 2002, at 04:42 Pacific/Honolulu, email@hidden wrote:
Hi All!
Well, I've done the various tutorials, etc. and now am ready to create my first killer app for OS X / Cocoa! :-)
Of course, being a "real" application I've already run into about 100 different design questions.. However, what
I would like is some opinions from the gurus out there how to handle this (what I think is) a pretty standard
cocoa design pattern..
The design pattern is such:
The application will have a "main" interface area .. sort of like "iTunes" in that there are multiple "sources", and
each source contains a set of stuff. The stuff in this case are documents.. specifically recipes .. So the main
window I want in the paradigm of a cook book (and there will be Table of Content views, index views, etc. etc.)
and then there is a document type for Recipe.. The source "drawer" will have the list of cook books
(and In Jaguar will be Rendevouz enabled! :-)
I have sort of designed the Recipe document windows to handle the recipe aspect.. and that works pretty slick..
However, there isn't much for the main window.. I created a main window and a drawer (for fun) ..
but when I run the program only a blank Recipe document comes up.. This is probably not too odd
since I registered only a recipe document type for the target application (and icons, etc.)
There is no associated window for the MainMenu.nib but a separate Nib for the main window..
How do I get the main window launched if I run the application and have it NOT open a blank
recipe document?
Not opening a blank recipe document is easy: your NSApp object needs a delegate, and the delegate needs to override the method
- (BOOL)applicationShouldOpenUntitledFile: (NSApplication *)sender
to return NO.
What is the appropriate pattern here for a multi-document window.. Is it multi-document since I want
all cook books to be handled by the main window, but recipes to pop up??
I would probably proceed along the lines you have started, using a document-based application template, but add a window object to your MainMenu.nib to be your central "housekeeping" window. This one should have its "visible when launched" flag checked in IB. It will need a controller object of some kind, probably a subclass of either NSWindowController or NSObject -- this object could be the same as your app's delegate object, i guess.
There are probably a lot of other ways to accomplish this...
Any advice much appreciated!
Hope it helps.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.