[ad_1]
I’ve an app within the App Retailer that’s fairly previous. I’m attempting to write down an up to date model. My unique app archived and unarchived information as beneath. I can not work out find out how to now entry this information in my up to date app.
- (void)saveGG
{
NSMutableData *information = [[NSMutableData alloc] init];
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:information];
[archiver encodeObject:givens forKey:@"Present"];
[archiver finishEncoding];
[data writeToFile:[self dataFilePath] atomically:YES];
}
- (void)loadGG
{
NSString *path = [self dataFilePath];
if ([[NSFileManager defaultManager] fileExistsAtPath:path])
{
NSData *information = [[NSData alloc] initWithContentsOfFile:path];
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:information];
items = [unarchiver decodeObjectForKey:@"Present"];
[unarchiver finishDecoding];
}
else
{
items = [[NSMutableArray alloc] initWithCapacity:20];
}
[ad_2]
