I have plist in my iphone app and I want to read and write an integer from my single to and form it.
I have this to read it:
scoreData *score = [scoreData sharedData];
filePath = @"stats.plist";
NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath];
score.highScore = [plistDict objectForKey:@"score"];
Then to write to it:
scoreData *score = [scoreData sharedData];
NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath];
[plistDict setValue:score.highScore forKey:@"score"];
[plistDict writeToFile:filePath atomically: YES];
I am getting an error in both parts:
Invalid conversion form objc_object* to int
and
Invalid conversion form int to objc_object
I appreciate any help, thanks.