Skip to Main Content
iPhone SDK Programming: Developing Mobile Applications for Apple iPhone and iPod touch
book

iPhone SDK Programming: Developing Mobile Applications for Apple iPhone and iPod touch

by Maher Ali
March 2009
Beginner to intermediate content levelBeginner to intermediate
396 pages
8h 44m
English
Wiley
Content preview from iPhone SDK Programming: Developing Mobile Applications for Apple iPhone and iPod touch

Chapter 9. File Management

This chapter covers the topic of file management. Here, you will learn how to use both high- and low-level techniques for storing/retrieving data to/from files. To perform high-level operations on files/directories you use instances of the NSFileManager class. NSFileHandle class is used in this chapter to demonstrate low-level file access.

In Section 9.1 we talk about the Home directory of the application. Next, Section 9.2 shows how to enumerate the contents of a given directory using the high-level methods of NSFileManager. In that section, you will learn more about the structure of the Home directory and where you can store files. After that, we learn in Section 9.3 how to create and delete directories. Next, Section 9.4 covers the creation of files. Section 9.5 deals with the topic of file and directory attributes, and you will learn how to retrieve and set specific file/directory attributes. In Section 9.6 we demonstrate the use of application bundles and low-level file access. Finally, we summarize the chapter in Section 9.7.

The Home Directory

The application and its data are contained within a single directory called the Home directory. Your application can only access this directory and its contents. The absolute path of the home directory on the simulator is different from that on the actual device. However, the organization and content are identical.

To access the absolute path of the Home directory, you can use the function call NSHomeDirectory() ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft® Office Access 2007 on Demand

Microsoft® Office Access 2007 on Demand

Steve Johnson - Perspection, Inc.
FileMaker Pro 14: The Missing Manual

FileMaker Pro 14: The Missing Manual

Stuart Gripman, Susan Prosser
Microsoft® Office Access™ 2007 Step by Step

Microsoft® Office Access™ 2007 Step by Step

Steve Lambert Joan Lambert and M. Dow Lambert III

Publisher Resources

ISBN: 9780470742822Purchase book