March 2014
Intermediate to advanced
672 pages
40h 11m
English
The NSFileManager class enables you to determine how much space is free on the iPhone and how much space is provided on the device as a whole. Listing 14-1 demonstrates how to check for these values and show the results using a friendly comma-formatted string. The values returned represent the total and free space in bytes.
Listing 14-1 Recovering File System Size and File System Free Size
- (void)logFileSystemAttributes { NSFileManager *fm = [NSFileManager defaultManager]; NSDictionary *fsAttr = [fm attributesOfFileSystemForPath:NSHomeDirectory() error:nil]; NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] ...
Read now
Unlock full access