title: Not able to save data into Plist?
body: <p>HI i have a <code>NSMutableDictionary</code> and i added 5 objects with keys (latitude, longitude, intensity, image, metaimage) then I tried to add it into a <code>NSMutableArray</code> and write that <code>NSMutableArray</code> to a .plist file. But Actually it is not writing. My .plist file is still empty.</p>
  
  <p>Please check my code:</p>
  
  <pre><code>paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  filePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"history.plist"];
  BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:filePath];
  
  if([latitude length]&gt;0 &amp;&amp; [longitude length]&gt;0){
  [dictValue setObject:latitude forKey:@"latitude"];
  [dictValue setObject:longitude forKey:@"longitude"];
  }
  [dictValue setObject:metaImage forKey:@"imageData"];
  [dictValue setObject:image forKey:@"image"];
  if([_intensity.text length]&gt;0){
  [dictValue setObject:_intensity.text forKey:@"intensity"];
  }else{
      intensityAlert=[[UIAlertView alloc]initWithTitle:@"Beta App" message:@"Please select intensity." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
      [intensityAlert show];
  }
  
  if(fileExists){
      finalArray=[[NSMutableArray alloc]initWithContentsOfFile:filePath];
      [finalArray addObject:dictValue];
      NSLog(@"dd%@",dictValue);
  
  }else{
      [finalArray addObject:dictValue];
      NSLog(@"new%@",finalArray);
  
  }
  [finalArray writeToFile:filePath atomically:YES];
  </code></pre>
  
  <p>after that  i use following code to check the data inside plist</p>
  
  <pre><code>   finalArray=[[NSMutableArray alloc]initWithContentsOfFile:filePath];
      NSLog(@"server%@",finalArray);
  </code></pre>
  
  <p>It printing nil value.</p>