title: Saving IOS data to plist
body: <p>I am writing these data to plist file, but every time I write, it replaces whatever was there before. I.e it is overwriting whatever data I had previously when I reload the page. How can I make the previous data persist or could someone point out what I am not doing correctly?</p>
  
  <pre><code>- (IBAction)buttonClickSave:(id)sender;
  {
   pathList=[self getFilePath];
  
      if(![[NSFileManager defaultManager] fileExistsAtPath:pathList])
      {
  
          [[NSFileManager defaultManager] copyItemAtPath:[[NSBundle mainBundle] pathForResource:@"adresses" ofType:@"plist" ]toPath:pathList error:nil];
      }
      NSString *Name = @"Names";
      NSString *email = @"email";
      NSString *phone = @"phone";
  
      NSMutableArray *values = [[NSMutableArray alloc] initWithObjects:Name, email, phone, nil];
      NSMutableArray *keys = [[NSMutableArray alloc] initWithObjects:kTitleKey, kEmail, kPhone, nil];
      NSDictionary *dict = [[NSDictionary alloc] initWithObjects:values forKeys:keys];
      [self.arraysData addObject:dict];
  
      [self.arraysData writeToFile:pathList atomically:YES];
  }
  </code></pre>