RE: Need advice on how to start processing after an NSDocument closes...
RE: Need advice on how to start processing after an NSDocument closes...
- Subject: RE: Need advice on how to start processing after an NSDocument closes...
- From: "William E. Jens" <email@hidden>
- Date: Fri, 12 Oct 2007 15:42:21 -0500
- Thread-topic: Need advice on how to start processing after an NSDocument closes...
I probably should've done a better job of explaining it. This is a file transfer application. When the user is done selecting their files within the document's window they click send. At this point the document should be saved, closed, and put into a queue to be worked on. There will be another window that displays progress as it works its way through each document in the queue. It's similar to sending an email, if you consider composing an email as working on a standalone document.
So I need a way to tell my AppController to start working on the queue after the document closes.
Thanks,
William
-----Original Message-----
From: "Emanuele "∞" Vulcano" [mailto:email@hidden]
Sent: Friday, October 12, 2007 2:58 PM
To: William E. Jens
Cc: email@hidden
Subject: Re: Need advice on how to start processing after an NSDocument closes...
Il giorno 12/ott/07, alle ore 21:00, William E. Jens ha scritto:
> I think under PowerPlant I used calls to ProcessCommand() within my
> document which were then handled in my main application after the
> document closed. I'm unclear on how this is done within Cocoa.
I believe that working on a document after it has been closed in the
UI is poor form. You can override
canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo: this way:
- call super's implementation (shows the "save/don't save/cancel"
panel). Change the delegate and selector so that you can process the
return call yourself. (Storing the original as a NSInvocation and
"volleying" can be a good idea.)
- if it reports that it can be saved and there are no unsaved
changes, then show a sheet with a progress indicator (maybe
indeterminate) and do post-processing. The user will not be able to
modify the document as long as the sheet is onscreen.
- when you're fine, call the original closing delegate with an
appropriate return value. Your document will be closed by this.
- ∞
_______________________________________________
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