title: Store NSString value in plist file in iOS
body: <p>My question in <code>UIActionSheet</code> button add to favourite click and copy <code>UITableViewCell</code> in nextview so i am using string value in store dynamic create plist file and first time click cell and open <code>UIActionSheet</code> and add to favourite <code>UIButton</code> click and copy 1 cell properly but second time add to favourite click and not add 2 item store only 1 new array item so my question in plist file at a time 1 value is add so any answer..`
  Store data from plist </p>
  
  <pre><code>       -(void)actionSheet:(UIActionSheet *)actionSheet   clickedButtonAtIndex:(NSInteger)buttonIndex
         {
  
         if (buttonIndex ==2) {
  
          FavoritesViewController *objfav= [self.storyboard instantiateViewControllerWithIdentifier:@"fav"];
  
           NSArray *paths = NSSearchPathForDirectoriesInDomains    (NSDocumentDirectory, NSUserDomainMask, YES);
          NSString *documentsPath = [paths objectAtIndex:0];
          NSString *plistPath = [documentsPath stringByAppendingPathComponent:@"manuallyData.plist"];
  
         [arrplist addObject:quote];
          NSDictionary *plistDict = [[NSDictionary alloc] initWithObjects: [NSArray arrayWithObjects: arrplist, nil] forKeys:   [NSArray arrayWithObjects: @"icon", nil]]; 
          NSString *error = nil;
          NSData *plistData = [NSPropertyListSerialization dataFromPropertyList:plistDict format:NSPropertyListXMLFormat_v1_0 errorDescription:&amp;error];
  
          if(plistData)
         {
            [plistData writeToFile:plistPath atomically:YES];   
         }
          else
         {
          }
  
          objfav.arrCopy = arrplist;
  
         [self.navigationController pushViewController:objfav    animated:YES];
         }
        }
  
       fetch data from dynamic create plist file in nextview
  
        NSArray *paths = NSSearchPathForDirectoriesInDomains   (NSDocumentDirectory, NSUserDomainMask, YES);
        NSString *documentsPath = [paths objectAtIndex:0];
       NSString *plistPath = [documentsPath stringByAppendingPathComponent:@"manuallyData.plist"];
  
        if (![[NSFileManager defaultManager] fileExistsAtPath:plistPath])
        {
        plistPath = [[NSBundle mainBundle] pathForResource:@"manuallyData" ofType:@"plist"];
        }
  
         NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:plistPath];
         arrCopy = [dict objectForKey:@"icon"];
  </code></pre>