View Full Version : plist updation problem

Jul 12, 2011, 05:31 AM
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.

as=[NSMutableArray new];
NSString *strr=[[NSBundle mainBundle] pathForResource:@"list" ofType:@"plist"];
NSDictionary *dict=[[NSDictionary alloc]initWithContentsOfFile:strr];
dictiona=[dict objectForKey:k];
// NSLog(@"%@",dictiona);
LAB.text=[dictiona valueForKey:@"name"];

texr.text=[NSString stringWithFormat:@"%@", [dictiona valueForKey:@"Description"]];
// self.aa=[dictiona valueForKey:@"Description"];
[as addObject:[NSString stringWithFormat:@"%@", [dictiona valueForKey:@"name"]]];


NSString *filePath = @"/Users/solutions/Desktop/tab 2/tab/List1.plist";

[as writeToFile:filePath atomically:TRUE];