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 protected]) > > 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: > https://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net > > This email sent to [email protected] _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
