Is calling "-applicationOpenUntitledFile:" for app-open (but not app-reopen) out of fashion?
Is calling "-applicationOpenUntitledFile:" for app-open (but not app-reopen) out of fashion?
- Subject: Is calling "-applicationOpenUntitledFile:" for app-open (but not app-reopen) out of fashion?
- From: Daryle Walker <email@hidden>
- Date: Wed, 02 Mar 2016 13:00:14 -0500
The Apple-Event handling guide says that “-applicationOpenUntitledFile:” (at least on OS X 10.4) is supposed to be called on app-open. That didn’t happen when creating a default project on Xcode 7 using Swift and without documents nor Core Data. I made a “newDocument:” action handler and a common create window method.
Once I added an “-applicationShouldOpenUntitledFile” method (and had it return TRUE), I did get a new window when I pressed the dock icon while the app had no windows, whether or not I switched to another app first. I figured out that was the reopen-app behavior, but the open-app behavior was still to do nothing. I can only guess that this is a deliberate change since 10.4; or that there’s some obscure setting to affect this (or a bug). This changed behavior is consistent when switching in and out of the app when using Command-Tab instead of the dock icon.
I got around this by explicitly calling “applicationShouldOpenUntitledFile” and “applicationOpenUntitledFile” during my application-delegate's did-finish-launching handler (which, as I said, supposed to have been the default since 10.4).
If this is a policy change, then the guide should be updated.
—
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com
_______________________________________________
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