O'Reilly logo

Advanced Mac OS X Programming: The Big Nerd Ranch Guide by Mark Dalrymple

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Make a File Browser

In this chapter, you are going to create a simple file browser using NSFileManager and NSTreeController, as shown in Figure 13.3

Figure 13.3  The file browser

The file browser

Create a new "Cocoa Application" project called Remover. Besides browsing, your app will allow the user to delete files and directories.

To represent the information about one directory entry, which may be a file or a directory, you will create a class called DirEntry. You will also be adding an NSTreeController, and the RemoverAppDelegate has already been created by the Xcode template. The class diagram is shown in Figure 13.4

Figure 13.4  Class diagram for Remover app ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required