Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?
Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?
- Subject: Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?
- From: Mike Abdullah <email@hidden>
- Date: Thu, 09 Feb 2012 17:40:26 +0000
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 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
> showing the file name and an animated progress bar with a "Cancel" NSButton.
>
> Simple question: How do I cancel the document when it is loading the data (sometimes it can take 10 seconds or more to load the data) if a user clicks the Cancel button ?
> Should I create an IBAction which generates an NSError ?
> But how does readFromURL:ofType:error get this error message (should I use a delegate ?)
>
> Any clue is greatly appreciated.
>
> Cheers,
>
> Gilles
>
>
> _______________________________________________
>
> 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
_______________________________________________
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