Re: Where and how do I know a save completed successfully?

2015-05-08 Thread Charles Jenkins
I may have a fundamental misunderstanding of how a document class, a text view, and an undo manager work together. I made these override functions in my Document class:   override func updateChangeCount( change:NSDocumentChangeType ) {     println( updateChangeCount: )    

Re: Where and how do I know a save completed successfully?

2015-05-08 Thread Quincey Morris
On May 8, 2015, at 02:46 , Charles Jenkins cejw...@gmail.com wrote: I may have a fundamental misunderstanding of how a document class, a text view, and an undo manager work together. It depends a bit on what kind of editing your document can have done to it. I already tried plugging the

Re: Where and how do I know a save completed successfully?

2015-05-08 Thread Quincey Morris
On May 8, 2015, at 17:50 , Charles Jenkins cejw...@gmail.com wrote: I tell the text view its delegate is my Document instance as soon as possible in windowControllerDidLoadNib: I don’t know the timing offhand, but it’s possible that the text view looks for its undo manager earlier. I’d

Re: Where and how do I know a save completed successfully?

2015-05-08 Thread Charles Jenkins
On May 8, 2015 at 1:09:01 PM, Quincey Morris (quinceymor...@rivergatesoftware.com) wrote: In this case, the text view should probably use the document undo manager, though you may have to do extra work to coordinate its use with your document’s needs. To configure it, you should tell the text

Where and how do I know a save completed successfully?

2015-04-29 Thread Charles Jenkins
I realized yesterday that my app doesn’t mark its data structures as clean (saved) after a save operation, and I’m trying to find the right place to do that. My NSDocument subclass implements saveToURL and fileWrapperOfType. Intuitively I thought I could probably mark things as saved at the

Re: Where and how do I know a save completed successfully?

2015-04-29 Thread Michael Crawford
1. The compiler crash should never happen, obviously, so that's a bug report. To be more clear - it doesn't matter how screwed up your source could possibly be, the compiler must never crash. If it does, then it's a bug in the compiler. It's quite likely that a slightly more subtle problem in

Re: Where and how do I know a save completed successfully?

2015-04-29 Thread Quincey Morris
On Apr 29, 2015, at 02:08 , Charles Jenkins cejw...@gmail.com wrote: override func saveToURL( url:NSURL, ofType typeName:String, forSaveOperation saveOperation: NSSaveOperationType, completionHandler:(NSError!) - Void ) { // snip Here I prepare my data

Re: Where and how do I know a save completed successfully?

2015-04-29 Thread Charles Jenkins
Thank you, Uli and everyone. I’ll check out updateChangeCount: I did file a bug report about the compiler crash caused by my syntax. —  Charles On April 29, 2015 at 10:19:22 AM, Uli Kusterer (witness.of.teacht...@gmx.net) wrote: On ٢٩‏/٠٤‏/٢٠١٥, at ١١:٠٨, Charles Jenkins cejw...@gmail.com

Re: Where and how do I know a save completed successfully?

2015-04-29 Thread Uli Kusterer
On ٢٩‏/٠٤‏/٢٠١٥, at ١١:٠٨, Charles Jenkins cejw...@gmail.com wrote: I think it most likely I’m doing this in the wrong place. But what’s the right place? Overriding NSDocument’s setFileModificationDate() would seem like the best way, but the NSDocument Programming guide says messages are