February 2014
Intermediate to advanced
560 pages
18h 58m
English
In addition to archiving and NSData’s binary read and write methods, there are a few more methods for transferring data to and from the filesystem. One of them, Core Data, is coming up in Chapter 23. A couple of others are worth mentioning here.
You have access to the standard file I/O functions from the C library. These functions look like this:
FILE *inFile = fopen("textfile", "rt");
char *buffer = malloc(someSize);
fread(buffer, byteCount, 1, inFile);
FILE *outFile = fopen("binaryfile", "w");
fwrite(buffer, byteCount, 1, outFile);
However, you will not see these functions used much because there are more convenient ways of reading and writing binary and text data. ...
Read now
Unlock full access