1

So I am currently making a scanApp where it is necessarry to sort different objects in to different categories. So when the user scans a code and gets the result text the result should be saved into the plist file with that category.

This is my approach currently.

    values = [[NSMutableArray alloc]initWithObjects:resultText.text, nil];
        [values writeToFile:[self saveFilePath] atomically:YES];

- (NSString *) saveFilePath {
    NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    return [[path objectAtIndex:0] stringByAppendingString:@"savefile.plist"];
}

It is the way that I've learnt, but how can I save things with (keys maybe) so that I can sort them.

Also how can I read the items with just that specific category.

Thanks everyone :)

4

0 回答 0