什么是NSdocumentdirectory限制大小?

时间:2014-10-17 11:33:44

标签: ios iphone nsdocumentdirectory

可能maximum size的{​​{1}} NSDocumentdirectory是多少?

stored中的saving images主要是NSDocumentdirectorybackediCloud

现在我想know可以存储的最大大小是多少。请帮忙。

1 个答案:

答案 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;
}

希望它有所帮助...