Objective C - 获取磁盘空间:

NSDictionary *fsAttr = [[NSFileManagerdefaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:nil];

    diskSize = [[fsAttr objectForKey:NSFileSystemSize]doubleValue] / 1000000000;

    

    diskSizeTemp = [[fsAttrobjectForKey:NSFileSystemFreeSize]doubleValue] / 1000000000;

你可能感兴趣的:(ios,apple,Objective-C,xcode,iPhone)