Re: Who is launching my helper?
Re: Who is launching my helper?
- Subject: Re: Who is launching my helper?
- From: Jerry Krinock <email@hidden>
- Date: Thu, 22 Jan 2015 21:23:50 -0800
On 2015 Jan 21, at 13:22, João Varela <email@hidden> wrote:
> I’m just guessing here but most probably your helper is being relaunched automatically by the OS itself by receiving a reopen command, because it was running before the user logged out. I think you need to either prevent that or handle that possibility in your code.
Thank you, João. That makes sense.
> I had a similar problem that this is only seen upon a reopen event and not upon a launch invoked by the user. If you are using objective C you could insert this in your NSApplication delegate:
>
> - (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication
> hasVisibleWindows:(BOOL)flag
> {
> return NO;
> }
>
> - (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender
> {
> return NO;
> }
I think my case is a little different than yours. Although it is indirectly linked to AppKit via a private framework, it does not have an “application” object; NSApp is nil, because I never call NSApplicationMain().
> If you are using plain C, then you really need to ignore such event or handle such arguments in your code.
I think that, without an NSApp to receive them, I am effectively ignoring them.
_______________________________________________
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