• 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: Prompting user (NSAlert) during document reading
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Prompting user (NSAlert) during document reading


  • Subject: Re: Prompting user (NSAlert) during document reading
  • From: edward taffel <email@hidden>
  • Date: Wed, 27 Aug 2014 12:37:01 -0400

On Aug 27, 2014, at 12:32 PM, Kyle Sluder <email@hidden> wrote:

worse & worse: very clever, kyle—thanks for pointing this out!

>> i had this problem too: you can show the alert on the main thread via e.g. performSelectorOnMainThread. (as was kindly pointed out to me by, if i remember correctly,  graham cox).
>
> I would not advise this. The main thread may itself be blocked due to waiting on your document via -performSychronousFileAccesdUsingBlock:.
>
> Matthew, could you perhaps perform automatic conversion, mark the document as untitled, and display a notice about automatic conversion once the document has been asked to -showWindows? This is the strategy I’ve suggested implementing in our own apps in the future.
>
> Something like:
>
> - initWithContentsOfURL:… {
>  self = [super initWithContentsOfURL:…];
>  if (_autoConverted)
>    [self setDraft:YES];
>  return self;
> }
>
> - showWindows {
>  [super showWindows];
>  if (_autoConverted) {
>    NSAlert *autoConversionAlert = …;
>    NSWindow *docWindow = self.windowControllers[0].window;
>    [alert beginSheetModalForWindow:window completionHandler:…];
> }
>
> --Kyle Sluder


_______________________________________________

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: 
 >Prompting user (NSAlert) during document reading (From: Matthew LeRoy <email@hidden>)
 >Re: Prompting user (NSAlert) during document reading (From: edward taffel <email@hidden>)
 >Re: Prompting user (NSAlert) during document reading (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Implemented -keyDown: in Yosemite NSViewController, but no class gets it
  • Next by Date: Re: Implemented -keyDown: in Yosemite NSViewController, but no class gets it
  • Previous by thread: Re: Prompting user (NSAlert) during document reading
  • Next by thread: Re: Prompting user (NSAlert) during document reading
  • Index(es):
    • Date
    • Thread