0
我需要將NSFileSystemSize轉換爲千兆字節。將NSFileSystemSize轉換爲千兆字節
NSDictionary * fsAttributes = [ [NSFileManager defaultManager]
fileSystemAttributesAtPath:NSTemporaryDirectory()];
NSNumber *totalSize = [fsAttributes objectForKey:NSFileSystemSize];
NSString *sizeInGB = [NSString stringWithFormat:@"\n\n %3.2f GB",[totalSize floatValue]/107374824];
//returns 69.86 GB
任何想法爲什麼它不會返回到8.0GB的?
尼斯漁獲物。我實際上去了: NSString * sizeInGB = [NSString stringWithFormat:@「\ n \ n%.2f GB」,[totalSize floatValue]/1024/1024/1024];似乎工作正常。 – WrightsCS 2010-05-15 05:58:21