need cocoa document-based application?

oholle

Registered
Hi,

I'm implementing an image editing application that could be invoked by another application or by double cliking an image file in finder.

It should be opened each window for each image file.
I mean it should be opened multiple times.

should I implement it as document-based application or can just a plain application do that?

If I should make it as a document-based application, is there any way to change a plain application to document-based application easily?
Because I already have a plain applicaion, I want to move it to a document-based application easily, if I should do.

Otherwise, please show me how to open the application multiple times.

Thanks
 
I wrote my program (see sig) without a Document-Based framework because it wasn't flexible enough for my needs without subclassing every class anyway.

I just separated my main window Nib from the MainMenu Nib and create a new instance whenever I need too, it's actually very easy this way because menu items can all be nil targeted and NSApp keeps a list of any windows you create.

I'd make a AppController of some sort and have it be the delegate of your Application.

NSApplication has a delegate method called application:eek:penFiles: that will pass you an array of the paths of each file opened by double-clicking or dragging to the app icon. Then you can open a new window instance for each file in the array.


Edit:

Of course, that version of my program in my sig doesn't technically open multiple windows... but with a couple minor changes to my opening routine it was relatively easy.
 
Back
Top