On Aug 27, 2009, at 5:03 PM, Gabriel Zachmann wrote:

My Cocoa application has the plist flag "application is background only" set.
(I believe, this is the former LSUIElement property.)

No; LSUIElement is still around, but if you have the friendly key view turned on (which is the default setting), it's called "application is agent (UI element)" or something like that.

Now I would like to display an alert dialog.

Unfortunately, this does not work; it even seems it makes the application hang

LSBackgroundOnly apps can connect to the window server, but can't display a UI, IIRC. You have two choices:

1. Make your app use LSUIElement instead, where this will work, though you'll have to manually bring the alert to the front using - activateIgnoringOtherApps:.

2. Use the CFUserNotification API instead of NSAlert.

Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________

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

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

Reply via email to