hi everybody, i am creating an app in which i need to create a new plist and updated it .when ever i tried to write data to it is taking the first string and storing in plist and for second string it is overwriting the first string in plist.how should i update my plist so that entire data will be reflected in the plist.please help me.
Code:
as=[NSMutableArray new];
NSString *strr=[[NSBundle mainBundle] pathForResource:@"list" ofType:@"plist"];
NSDictionary *dict=[[NSDictionary alloc]initWithContentsOfFile:strr];
dictiona=[dict objectForKey:k];
//NSLog(@"%@",k);
// NSLog(@"%@",dictiona);
LAB.text=[dictiona valueForKey:@"name"];
texr.text=[NSString stringWithFormat:@"%@", [dictiona valueForKey:@"Description"]];
// self.aa=[dictiona valueForKey:@"Description"];
NSLog(@"%@",as);
[as addObject:[NSString stringWithFormat:@"%@", [dictiona valueForKey:@"name"]]];
-(IBAction)saveBookMark{
NSString *filePath = @"/Users/solutions/Desktop/tab 2/tab/List1.plist";
[as writeToFile:filePath atomically:TRUE];
Last edited by a moderator: