• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How to cancel a loading document in NSDocument's readFromURL:ofType:error method ? (From: Gilles Celli <email@hidden>)

  • Prev by Date: Re: drawing 1 bit images, and image resolution
  • Next by Date: Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?
  • Previous by thread: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?
  • Next by thread: Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?
  • Index(es):
    • Date
    • Thread