Hi friends,
I have stored the data into the plist(documents directory) and retrieved the data from the plist and displayed in the table view. Now i want to remove the plist, when i closed my application. How can i do that?. I have removed plist in my controller. But how can i remove the plist after i closed my application.
For Eg :
FirstViewController.m:
-(NSString *) saveFilePath::(NSString *)tagString
{
NSArray *arr = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *strPath = [[arr objectAtIndex:0] stringByAppendingPathComponent:tagString];
return strPath;
}
If i want to remove the plist in my controller, i have used this code,
[[NSFileManager defaultManager] removeItemAtPath:[self saveFilePath:tagString] error:NULL]; (Where do i put this code into my delegate method?)
But i want to remove the plist, when my application is closed. Because i have used to plist in my controller temporarily only. So i want to remove it? Is any possible to remove plist when i closed my apps?
Please guide me!
Thanks.