可能maximum size
的{{1}} NSDocumentdirectory
是多少?
我stored
中的saving
images
主要是NSDocumentdirectory
,backed
为iCloud
。
现在我想know
可以存储的最大大小是多少。请帮忙。
答案 0 :(得分:-1)
此代码给出了确切的字节数。
- (unsigned long long int)folderSize:(NSString *)folderPath {
NSArray *folderArray = [[NSFileManager defaultManager] subpathsOfDirectoryAtPath:folderPath error:nil];
NSEnumerator *folderEnumerator = [folderArray objectEnumerator];
NSString *folderName;
unsigned long long int fileSize = 0;
while (folderName = [folderEnumerator nextObject]) {
NSDictionary *folderDictionary = [[NSFileManager defaultManager] fileAttributesAtPath:[folderPath stringByAppendingPathComponent:fileName] traverseLink:YES];
folderSize += [folderDictionary folderSize];
}
return folderSize;
}
希望它有所帮助...