plist updation problem

Discussion in 'iOS Programming' started by ghousemd, Jul 12, 2011.

  1. ghousemd, Jul 12, 2011
    Last edited by a moderator: Jul 12, 2011

    macrumors newbie

    Jun 25, 2011
    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 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];

Share This Page