NSUserDefaults storage size capacity?
I'm planning on storing some thumbnail images (their NSData) and then on restart of app recreate those images from the NSData.
Thanks
macbook, Mac OS X (10.5.4)
You can make a difference in the Apple Support Community!
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
macbook, Mac OS X (10.5.4)
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *myKey = @"key";
int sizeOfFile = 666; // Fill in proper file size here
NSData myObject;
NSString *someFilePath = @"PathToYourFileHere";
for(int i = 1; i < 9999999999999999; i++)
{
myObject = [NSData dataWithContentsOfFile:someFilePath];
[defaults setObject: forKey:[NSString stringWithFormat:@"%@%i", myKey, i]];
NSLog(@"Iteration: %i, TotalWritten: %i", i, i * sizeOfFile);
}
Property List Programming Guide: When to Use Property Lists
Many applications require a mechanism for storing information that will be needed at a later time. For situations where you need to store small amounts of persistent data—say less than a few hundred kilobytes—property lists offer a uniform and convenient means of organizing, storing, and accessing the data.
In some situations, the property list architecture may prove insufficient. If you need a way to store large, complex graphs of objects, objects not supported by the property list architecture, or objects whose mutability settings must be retained, use archiving.....
...Note that property lists should be used for data that consists primarily of strings and numbers. They are very inefficient when used with large blocks of binary data.
NSUserDefaults storage size capacity?