Saturday, November 7, 2026
HomeiOS Developmentios - How you can replace my new code in order that...

ios – How you can replace my new code in order that I can unarchive information from my previous app within the App Retailer?

[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]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments