Chapter 18. Nonstandard Apps

For the majority of this book, we’ve talked about GUI applications designed to run on either OS X or iOS. These applications receive user input via the mouse, keyboard, or touch screen, display information via the screen and are launched by double-clicking them on OS X or tapping them on iOS.

However, not every piece of software that you write is a traditional app. In some cases, you might want to create something that the user doesn’t need to see—for example, a background application that periodically talks to the Internet. Another case where you don’t want to build a traditional app is when you want to create a preference pane, which the user can access via the System Preferences application.

In this chapter, you’ll learn how to build apps for OS X that don’t fit the mold of standard applications. Specifically, you’ll learn how to build command-line tools (which don’t use a GUI), system preference panes, and applications that add an item to the system-wide menu bar.

Note

This chapter only applies to OS X—on iOS, you can only build apps that the user accesses via the home screen and that display an interface. Command-line tools and daemons aren’t supported.

Command-Line Tools

The simplest possible application on OS X is a command-line tool. This kind of app never presents a GUI to the user, but instead sends and receives output via the command line.

The command line is the fundamental method of communication for computer programs; every Unix-based system has ...

Get Learning Cocoa with Objective-C, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.