1

I am trying to create a Service for Finder, but my application doesn't need to have an UI. Well I need an UI only to request for more information from the user, which my app might need sometime.

But the app should launch without any UI and no icon in the dock. How do I do that? I tried deleting the xib file but now I get "Could not connect the action buttonPressed: to target of class NSApplication" warning.

AppleGrew
  • 9,302
  • 24
  • 80
  • 124

1 Answers1

3

Sounds like you want to use LSUIElement.

http://www.cocoadev.com/index.pl?LSUIElement

StilesCrisis
  • 15,972
  • 4
  • 39
  • 62
  • Ok Will try this when I reach home. I hope this works in XCode 4 (on Lion). – AppleGrew Jan 25 '12 at 07:39
  • 1
    Xcode has nothing to do with it. `LSUIElement` is a key you can set in the Info.plist file in your app's bundle. Its value is interpreted by Launch Services when your app is launched. Sounds like you need to [learn about bundles](http://developer.apple.com/library/mac/#documentation/General/Conceptual/DevPedia-CocoaCore/Bundle.html). – Rob Keniger Jan 25 '12 at 08:53
  • I also took the help of - http://stackoverflow.com/questions/620841/how-to-hide-the-dock-icon thread. But this solves part of the problem. What should I do to create a Windowless NSApplication. Right now I have deleted the nib file but then I get "Could not connect the action buttonPressed: to target of class NSApplication" warning. – AppleGrew Jan 25 '12 at 14:26
  • 2
    You aren't supposed to delete the nib!! Just delete the window out of the nib. – StilesCrisis Jan 25 '12 at 16:12