Re: NSDocument's Open File Panel unresponsive when opening large file from disc
Re: NSDocument's Open File Panel unresponsive when opening large file from disc
- Subject: Re: NSDocument's Open File Panel unresponsive when opening large file from disc
- From: Mike Abdullah <email@hidden>
- Date: Mon, 28 Jan 2013 17:44:22 +0000
On 28 Jan 2013, at 16:46, Gilles Celli <email@hidden> 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. Process currentFileContents in a new object myDataFile (withc class DataFileParser) by extracting the data values etc. with NSScanner, this takes most time
> 3. return YES if everything is OK in readFromURL
>
> So I thought that then makeWindowControllers comes in action ?!...
> In makeWindowControllers:
> 1. Pass myDataFile if it's not nil > create a new MainWindowController and pass myDataFile to it like
> mainWindowController = [[DataViewerWindowController alloc] initWithDataFile:myDataFile];
> [self addWindowController:mainWindowController];
>
> Hope this clarifies a little bit what I'm doing…well doing something wrong …..
That all sounds totally reasonable to me. The point is you're saying the open panel is making your app unresponsive. If the app's unresponsive, that means the main thread is doing too much work. So you need to get from Instruments or similar an answer to the question "what is the main thread doing that takes so long?"
_______________________________________________
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