I've got a Core Data Document Based App (OS X) that opens an untitled document if the user hasn't specified a document to open on startup. Now that Lion reopens documents on launch, I need to know how to prevent this untitled document from opening if there are documents to be reopened from the last time the program ran.
Previously, I did some checking in
- (BOOL) applicationShouldOpenUntitledFile: (NSApplication *) sender
and returned YES
or NO
appropriately. What should I check now to prevent an untitled document from being opened when there are documents to restore?
From Lion's release notes:
As part of the restorable windows feature, the application delegate may not be asked to create an Untitled window at launch in some circumstances. This was found to cause crashes in certain apps, so these apps will maintain 10.6 behavior of more often opening Untitled windows. When these apps are recompiled on 10.7, they will acquire the 10.7 behavior. For maximum compatibility, do not depend on being asked to create an Untitled window at launch.
Basically, they're saying "it may not work and we're not going to say why, so it's best not to rely on it at all."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With