Reputation: 4929
My app downloads files. How much space I can use for downloaded files? App size is 3-4 mbytes. I save files to documents folder.
Upvotes: 1
Views: 867
Reputation: 9906
There is no capacity limit except the available storage (except for the fact that the app may see a bit less storage then what is actually available on the device - some may be saved for the OS).
To get the free storage available on the device (as your app is concerned):
NSString* docsDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath:docsDir error:NULL];
unsigned long long freeSpaceInBytes = [[fileAttributes objectForKey:NSFileSystemFreeSize] unsignedLongLongValue];
NSLog(@"Memory Capacity of %llu MiB.", ((freeSpaceInBytes/1024ll)/1024ll));
Upvotes: 6