Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?

2012-02-10 Thread Gilles Celli
Mike, I'm not sure what you mean to set the cancel flag on the main thread. I have done this so far, but I'm still stuck: In my NSDocument readFromURL:ofType:error: method it init's a progressLoading WindowController (which shows up the window with progress bar and Cancel button). In my

Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?

2012-02-10 Thread Mike Abdullah
I'm sure I'm doing something wrong here :-( Any clues ? Yep, here we go: On 10 Feb 2012, at 15:28, Gilles Celli wrote: In my NSDocument readFromURL:ofType:error: method it init's a progressLoading WindowController (which shows up the window with progress bar and Cancel button). In my

Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?

2012-02-10 Thread Gilles Celli
Opening the ASCII file can take up to 15-20 sec ( 150MB), so I made some changes as you suggested by moving the progressWindowController alloc/init before the allocation of asciiFileContents... And you're right I should have put addWindowController: in makeWindowController This makes the

Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?

2012-02-10 Thread Mike Abdullah
On 10 Feb 2012, at 21:25, Gilles Celli wrote: Opening the ASCII file can take up to 15-20 sec ( 150MB), so I made some changes as you suggested by moving the progressWindowController alloc/init before the allocation of asciiFileContents... And you're right I should have put

How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?

2012-02-09 Thread Gilles Celli
Hi, I searched the mailing-list but didn't find an answer….so sorry if this was posted before: I've setup a document based application which can read large ASCII data files (150MB). When opening the document the method readFromURL:ofType:error is used which then opens a small feedback window

Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?

2012-02-09 Thread Mike Abdullah
Set an ivar in your document which the read method checks periodically. If the user cancelled, then return NO with an NSUserCancelledError. On 9 Feb 2012, at 16:01, Gilles Celli wrote: Hi, I searched the mailing-list but didn't find an answer….so sorry if this was posted before: I've

Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?

2012-02-09 Thread Kyle Sluder
On Thu, Feb 9, 2012 at 8:01 AM, Gilles Celli gilles.ce...@ecgs.lu wrote: Hi, I searched the mailing-list but didn't find an answer….so sorry if this was posted before: I've setup a document based application which can read large ASCII data files (150MB). When opening the document the

Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?

2012-02-09 Thread Gilles Celli
Mike, Kyle, Thanks for the quick answers! Yes I'm targeting Mac OS X 10.6 and later so canConcurrentlyReadDocumentsOfType: is a welcome addition, I completely forgot that. Strangely if I put the method canConcurrentlyReadDocumentsOfType: inside my NSDocument I get a warning when trying to

Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?

2012-02-09 Thread Mike Abdullah
On 9 Feb 2012, at 20:23, Gilles Celli wrote: Mike, Kyle, Thanks for the quick answers! Yes I'm targeting Mac OS X 10.6 and later so canConcurrentlyReadDocumentsOfType: is a welcome addition, I completely forgot that. Strangely if I put the method canConcurrentlyReadDocumentsOfType:

Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?

2012-02-09 Thread Jeffrey Oleander
From: Gilles Celli gilles.ce...@ecgs.lu Subject: Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ? To: Kyle Sluder kyle.slu...@gmail.com, Mike Abdullah cocoa...@mikeabdullah.net Cc: cocoa-dev@lists.apple.com Date: Thursday, 2012 February 9, 14:23

Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?

2012-02-09 Thread Kyle Sluder
On Feb 9, 2012, at 7:08 PM, Jeffrey Oleander jgo...@yahoo.com wrote: I don't get it. I though with OS X one of the great benefits was finally having pre-emptive multi-processing instead of co-operative multi-processing. Sure, when the user clicks Cancel it's an event, it gets stuffed