Possible Duplicate:
iPhone Dev – Edit objects in Array from Plist
I have a number of different variables like strings and integers that I want to save into a ‘Plist’ that I already have set up. I’m already reading the ‘Plist’ however I’m unsure of how to alter and save variables back into the ‘Plist’ afterwards.
UPDATE
I’m already using the following code to load up the plist file and read the keys in the ‘viewDidLoad’ method.
NSString* filePath = [[NSBundle mainBundle] pathForResource:@"questions" ofType:@"plist"];
categories = [NSArray arrayWithContentsOfFile:filePath];
Within my ‘Plist’ I have an array for each item, which I then read.
pair = [categories objectAtIndex:questionCounter];
plistQuestion = [pair objectAtIndex:0];
plistAnswer = [pair objectAtIndex:1];
plistAnswer2 = [pair objectAtIndex:2];
completed = [pair objectAtIndex:3];
Thanks in advance!
1 Answer