From Project to App

An app file is really a special kind of folder called a package (and a special kind of package called a bundle). The Finder normally disguises a package as a file and does not dive into it to reveal its contents to the user, but you can bypass this protection and investigate an app bundle with the Show Package Contents command. By doing so, you can study the structure of your built app bundle.

We’ll use the Empty Window app that we built earlier as a sample minimal app to investigate. You’ll have to locate it in the Finder; by default, it should be somewhere in your user Library/Developer/Xcode/DerivedData folder, as shown in Figure 6-14. (In theory, you should be able to select the app under Products in the Navigation pane and choose File → Show in Finder, but there seems to be a bug preventing this.)

The built app, in the Finder

Figure 6-14. The built app, in the Finder

In the Finder, Control-click the Empty Window app and choose Show Package Contents from the contextual menu.

Contents of the app package

Figure 6-15. Contents of the app package

Looking inside our minimal app bundle (Figure 6-15), we see that it contains just five files:

PkgInfo
A tiny text file reading APPL????, signifying the type and creator codes for this app. The PkgInfo file something of a dinosaur; it isn’t really necessary for the functioning of an ...

Get Programming iOS 4 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.