We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
可以尝试一下下面的方法
unsigned long long totalFreeSpace = 0; if (@available(iOS 11.0, *)) {
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath:NSTemporaryDirectory()]; NSDictionary *results = [fileURL resourceValuesForKeys:@[NSURLVolumeAvailableCapacityForImportantUsageKey] error:nil]; totalFreeSpace = [results[NSURLVolumeAvailableCapacityForImportantUsageKey] longLongValue]; }else { NSDictionary *fattributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:nil]; totalFreeSpace = [[fattributes objectForKey:NSFileSystemFreeSize] unsignedLongLongValue]; } return totalFreeSpace;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
可以尝试一下下面的方法
unsigned long long totalFreeSpace = 0;
if (@available(iOS 11.0, *)) {
The text was updated successfully, but these errors were encountered: