plist value changing?
i changed pList value through coding.it works fine.but after exiting application,Plist has same value(witho开发者_JS百科ut changing value) any help?code is as
-(void)ChangePlist:(NSString *)key
{
NSDictionary *info = [[NSBundle mainBundle] infoDictionary];
[info setValue:@"1" forKey:key];
}
You are not saving the changed dictionary back to Info.plist
. The NSDictionary
you get is simply an in-memory dictionary. It's not bound to save changes back to Info.plist
automatically. You can send it the writeToFile
message with the path to the Info.plist
file as an argument to save it there.
When you build a project in XCode it will create a new folder and put everything there so any changes made programmatically will only be visible in that folder.
Open a Terminal and go to here:
~/Library/Application Support/iPhone Simulator/User/Applications
精彩评论