Helper Application
How do you create a GUI-Less Application that runs in the background without appearing in th开发者_运维问答e dock or in the application switcher.
If it's a background application the still needs to interact with the user, see LSUIElement. If it's really just called to do some processing and never talks to the user at all, you can just make it a Foundation tool or really any other kind of plain vanilla program.
You need to set either LSUIElement (Application is Agent) or LSBackgroundOnly (Application is background only) in your app's Info.plist. LSUIElement is usually for status bar apps, and LSBackgroundOnly for apps that have no UI at all.
You can Apple's documentation on these flags here.
精彩评论