Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ghousemd

macrumors newbie
Original poster
Jun 25, 2011
21
0
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:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.