I want to write the data in the textfields(username and password) in to the plist.I wrote the below code ,But my Jsonapp.plist is not updated.
Code:
-(void)writeToList
{
NSLog(@"writeToList");
NSString *path = [[NSBundle mainBundle] bundlePath];
NSString *finalPath = [path stringByAppendingPathComponent:@"Jsonapp.plist"];
NSMutableDictionary *plistData = [[NSMutableDictionary alloc ]initWithContentsOfFile:finalPath];
NSString *username =txtUsername.text;
NSString *password =txtPassword.text;
NSLog(@"Username=%@",username);
[plistData setValue:username forKey:@"Username"];
[plistData writeToFile:finalPath atomically:YES];
}