how to delete contents from plist programmatically ?
- by srikanth rongali
I have a plist file. I want to delete the data from the plist. How can I do it programmatically ?
My Plist have an array cells. cells is filled by dictionaries . Each dictionary is filled by string.
I used the following way.
NSString* plistPath1 = [[NSBundle mainBundle] pathForResource:@"details" ofType:@"plist"];
[cells removeObjectAtIndex:[clickedButtonPath row]];
NSMutableArray *array1 = [[NSMutableArray alloc] initWithCapacity:4];
array1 = cells;
[array1 writeToFile:plistPath1 atomically: YES];
But the plist is not taking the changes.
Thank you.