Re: Untitled files and NSApp delegate
Re: Untitled files and NSApp delegate
- Subject: Re: Untitled files and NSApp delegate
- From: Dimitri Bouniol <email@hidden>
- Date: Fri, 30 Jun 2006 12:40:00 -0700
I am under the impression (I might and probably am wrong) that each
NSDocument has to have its own Window. In my app, I would like to
have a complex layout where I could have tabbed windows that could
change window, or be opened in any other of my apps with ease. I plan
to use NSFileManager to handle saving and opening, and to have a
complete array of documents (NSObjects, not NSDocuments), and a
complete array of all windows that would handle documents. I also
have a delegate of NSApp to get the following methods:
- (BOOL)applicationOpenUntitledFile:(NSApplication *)
theApplication // only called when you click the dock icon
- (BOOL)application:(NSApplication *)theApplication openFile:
(NSString *)filename //works
- (void)application:(NSApplication *)sender openFiles:(NSArray *)
filenames //works, even when there is only 1 file
On Jun 30, 2006, at 6:40 AM, I. Savant wrote:
It sounds like you're making this far more difficult than needed.
If you don't want to handle documents, use a standard Cocoa
application (non-document-based). If you want to handle documents,
use a Cocoa document-based application. You don't have to implement
everything with your NSDocument subclass. Just implement what you
need to get the document opened and get at its contents the "Cocoa
Way".
A more focused response, however, will probably require more
information from you as to exactly what you're doing with the
contents of these documents. If you're going to manipulate them at
all, you really should be using the document architecture and
you're only making it harder on yourself trying to short-circuit it.
Unless I've completely misunderstood your request, my advice to
you is to stop where you're at and review the document
architecture, then reevaluate your approach. This architecture
practically does everything for you when dealing with opening /
manipulating documents of any kind; it's unlikely that bypassing it
altogether is the right approach for your project.
I hope this is helpful.
--
I.S.
--
Dimitri Bouniol
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden