tags:

views:

23

answers:

2

Which classes / frameworks must I look at? I don't want to use 3rd party libs, so just plain old, boring default solutions to read / write text files and stuff like that... Is there something like a File IO framework?

+1  A: 

I only know 2 ways to read/write to the disk in iphone:

1/ NSUserDefaults: really restricted to some data type only. Look at it here:

A tutorial on NSUserDefault

NSUserDefault Class Reference

2/ NSCoder: you will encode your data and save it to hard disk then you can initWithCoder to get data back. Look at here:

A good article to begin with

NSCoder Class Reference

Archive and Serialization

Just read again that you want to do a text file, so NSFileHandle is also a good choice for you, you can look at here.

3/ NSFileHandle.

There is a FILE IO part here

vodkhang
+1  A: 

You don't need a framework. You can just good old fashioned POSIX calls open, read, write, and all their friends work just as you would suspect. If you want to move up a level you can use use NSFileHandle to have a Cocoa level interface that is a bit more Objective-C flavored.

Ukko