• 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: Lion's 'restore windows' vs. app with initial 'login'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lion's 'restore windows' vs. app with initial 'login'


  • Subject: Re: Lion's 'restore windows' vs. app with initial 'login'
  • From: Eric Slosser <email@hidden>
  • Date: Wed, 08 Feb 2012 09:29:24 -0500

On Feb 7, 2012, at 2:09 PM, Quincey Morris wrote:

> On Feb 7, 2012, at 09:27 , Eric Slosser wrote:
>
>> I've got an app that has a login step at the beginning.  Until the user has logged on, it's inappropriate to display the documents that were open when the last user quit.  Lion's 'restore windows' feature happens while my login dialog is still open.  I've looked at the slides for the WWDC 2011 session "Resume and Automatic Termination in Lion" and they don't address the concept of an app with a startup gateway like a login dialog.
>>
>> Through experimentation, I found that 'resume' is happening through calls to -[MyDocController openDocumentWithContentsOfURL:display:error].  I plan to put a check for login there.  If the user hasn't logged in, I'll save the URLs, return NULL, and process them later.  When I process them, I can also filter out URLs that 'belong' to someone other than the current logged in user.
>
> 'openDocumentWithContentsOfURL:display:error:' is deprecated in Lion, so it's surprising that it's being called instead of 'openDocumentWithContentsOfURL:display:completionHandler:', and maybe you can't rely on it being called in future updates.

> An alternative approach might be to override 'restoreDocumentWindowWithIdentifier:state:completionHandler:'

Thanks for the thought.  I looked at that routine (and header), but the app in question still supports Tiger and PowerPC, so it was easier to subclass openDocumentWithContentsOfURL:display:error:.


_______________________________________________

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: 
 >Lion's 'restore windows' vs. app with initial 'login' (From: Eric Slosser <email@hidden>)
 >Re: Lion's 'restore windows' vs. app with initial 'login' (From: Quincey Morris <email@hidden>)

  • Prev by Date: async loading crash
  • Next by Date: Re: How to get bookmarks data for non-existing files
  • Previous by thread: Re: Lion's 'restore windows' vs. app with initial 'login'
  • Next by thread: Re: boundingRectWithSize problem?
  • Index(es):
    • Date
    • Thread