Adding data to the plist dynamically and then populating the tableview cells
<p>I am developing an application where i have created the plist ,and i am adding data to it..but what is happening is that everytime the data is overwritten and the previous data is lost,I mean suppose i add one name called rocky,next time when i add rock ,rocky gets overwritten with rock,but what i want is my pliat should contain both rocky and rock and so on...I am adding the data o plist by user entry....</p>

<p>here is my code below..</p>

<p>-(IBAction) myplist:(id) sender//the data is saved in a plist by clicking on this button</p>

<p>{</p>

<pre><code>NSLog(@"mylist  Clicked");    



NSMutableArray *array = [[NSMutableArray alloc] init];

[array addObject:searchLabel.text];

   // get paths from root direcory

NSArray *paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES);

// get documents path

NSString *documentsPath = [paths objectAtIndex:0];

// get the path to our Data/plist file

NSString *plistPath = [documentsPath stringByAppendingPathComponent:@"Data.plist"];



// This writes the array to a plist file. If this file does not already exist, it creates a new one.

   [array writeToFile:plistPath atomically: TRUE];
</code></pre>

<p>}</p>
