On 2015 Jan 21, at 13:22, João Varela <joaocvar...@gmail.com> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to