Exercises

  1. Use NSDirectoryEnumerator to calculate the true size of the selected directory.

  2. Use NSWorkspace to find and display an icon for the selected file or directory in an NSImageView.

  3. If the user double-clicks a file, open it. This also uses NSWorkspace.

  4. Use NSWorkspace to recycle the selected item (move it to the trash) rather than deleting it.

  5. Use DirEntry in an iPhone app to display the contents of the application’s sandbox.

  6. Store the user’s current location in Remover and restore it on next program launch. Make sure it works after reboots.

  7. Remover currently starts up showing the top of the file system. Change Remover so that it starts by showing all mounted volumes at the top level instead.

Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide 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.