Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-02-04 Thread Gilles Celli
Mike, Again you were right ! The data processing was blocking the main queue with large files, so that the Open Panel didn't close immediately. It works now with large data files too by using dispatch_barrier_async() in the init file of my app's WindowController class. I have some deleted

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-02-04 Thread Kyle Sluder
On Mon, Feb 4, 2013, at 08:05 AM, Gilles Celli wrote: I have some deleted threads though with uncommitted CATransaction on OS X 10.8.2 only (but not on OS X 10.7.x) to display the graphs… but that could be a bug of the graphs framework…need to check…. This usually happens because your

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-02-04 Thread Gilles Celli
Thanks Kyle, I've setup my code to update the UI on the main thread, as recommended... but strangely enought the uncommitted CATransaction warning only happes on OS X 10.8.x and not on 10.7.x (XCode 4.6). Gilles On 4 févr. 2013, at 17:56, Kyle Sluder k...@ksluder.com wrote: On Mon, Feb 4,

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-31 Thread Gilles Celli
Hmm well Mike you were right! I was too enthusiastic yesterday by claiming that I fixed my Open Panel problem… I tried it here on my old Mac Mini with OS X 10.7 and the Open Panel still stays open even with my newer code with windowDidLoad tec.…strangely enough but at home it did work with my

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-31 Thread Mike Abdullah
On 31 Jan 2013, at 15:06, Gilles Celli gilles.ce...@ecgs.lu wrote: Hmm well Mike you were right! I was too enthusiastic yesterday by claiming that I fixed my Open Panel problem… I tried it here on my old Mac Mini with OS X 10.7 and the Open Panel still stays open even with my newer code

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-30 Thread Mike Abdullah
On 29 Jan 2013, at 16:18, Gilles Celli gilles.ce...@ecgs.lu wrote: I looked a little bit today here with my application, and the term unresponsive for the Open Panel is not appropriate: it should be stays open when reading /processing the big data file and then the panel closes. The

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-30 Thread Gilles Celli
Thank you Quincey for your very good explanation and to Mike taking the time to making some tests ! I really appreciate it! I tried a few things and it seems that when preparing the graphs with a lot of data the Open Panel stays open….but disappears immediately when only reading and extracting

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-30 Thread Gilles Celli
Well I think I found it: now the Open Panel disappears when opening large files in my document-based app. Now the process of the data file is done in the subclassed NSWindowController windowDidLoad method. I've found something here on the Cocoa mailing list from 2002!:

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-30 Thread Mike Abdullah
On 30 Jan 2013, at 21:29, Gilles Celli gilles.ce...@ecgs.lu wrote: Well I think I found it: now the Open Panel disappears when opening large files in my document-based app. Now the process of the data file is done in the subclassed NSWindowController windowDidLoad method. I've found

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-29 Thread Gilles Celli
I looked a little bit today here with my application, and the term unresponsive for the Open Panel is not appropriate: it should be stays open when reading /processing the big data file and then the panel closes. The main processing time is when converting date/time to NSTimeIntervalSince1970,

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-29 Thread Steve Mills
On Jan 29, 2013, at 10:18:57, Gilles Celli gilles.ce...@ecgs.lu wrote: Simply put, the Open Panel should be closed, but it stays open until the data file has been processed and the data displayed as a graph. There should be a way to close NSDocument openPanel but didn't find anything

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-29 Thread Quincey Morris
On Jan 29, 2013, at 08:18 , Gilles Celli gilles.ce...@ecgs.lu wrote: Simply put, the Open Panel should be closed, but it stays open until the data file has been processed and the data displayed as a graph. If you're using one of the 'begin…completionHandler:' methods to show the panel, you

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-29 Thread Gilles Celli
Ok, sounds good...but what bothers me is that I'm using an NSDocument based app: so can I use without problems NSOpenPanel's beginSheetModalForWindow:completionHandler: method instead of using NSDocument's readFomURL:ofType:error ? On 29 janv. 2013, at 18:36, Quincey Morris

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-29 Thread Quincey Morris
On Jan 29, 2013, at 12:00 , Gilles Celli gilles.ce...@ecgs.lu wrote: Ok, sounds good...but what bothers me is that I'm using an NSDocument based app: so can I use without problems NSOpenPanel's beginSheetModalForWindow:completionHandler: method instead of using NSDocument's

NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-28 Thread Gilles Celli
Hi, I've the following problem on OS X 10.6 and later: My document based app (reads some small and big (150MB or more) ASCII files to process data, I'm using the method: readFromURL:ofType:error: and returning canConcurrentlyReadDocumentsOfType: to YES. When trying to open a bigger file the

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-28 Thread Mike Abdullah
On 28 Jan 2013, at 13:18, Gilles Celli gilles.ce...@ecgs.lu wrote: Hi, I've the following problem on OS X 10.6 and later: My document based app (reads some small and big (150MB or more) ASCII files to process data, I'm using the method: readFromURL:ofType:error: and returning

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-28 Thread Gilles Celli
Thanks Mike, I just looked with Instruments and well yes to process the data my app uses NSScanner a lot to extract date/time with its corresponding data values, so this takes about 99,6% Running-Time (gasp! )… One error (I think) was that I processed the data inside the

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-28 Thread Mike Abdullah
On 28 Jan 2013, at 15:25, Gilles Celli gilles.ce...@ecgs.lu wrote: Thanks Mike, I just looked with Instruments and well yes to process the data my app uses NSScanner a lot to extract date/time with its corresponding data values, so this takes about 99,6% Running-Time (gasp! )… One

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-28 Thread Gilles Celli
Please don't be scared ;-) Well I'm little bit in a hurry … will look more closely tonight, but: What I've done til now is inside readFromURL:ofType:error: 1. Open the file and store it NSString currentFileContents 2. Process currentFileContents in a new object myDataFile (withc class

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-28 Thread Mike Abdullah
On 28 Jan 2013, at 16:46, Gilles Celli gilles.ce...@ecgs.lu wrote: Please don't be scared ;-) Well I'm little bit in a hurry … will look more closely tonight, but: What I've done til now is inside readFromURL:ofType:error: 1. Open the file and store it NSString currentFileContents 2.