Method to get a value from plist   
NSString *path = [[NSBundle mainBundle] pathForResource:@"PlistX" ofType:@"plist"];
    NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path];
    int number = [[[[dict objectForKey:@"One"] objectForKey:@"Two"]objectForKey:@"Three"] intValue];
    NSLog(@"%d",number); 
Writing to plist
NSDictionary *dict;
NSData *data = [NSPropertyListSerialization dataWithPropertyList:dict format:NSPropertyListXMLFormatv10 options:0 error:&error];
[data writeToFile:self.saveToPath atomically:YES];
                       
                    
0 Comment(s)