In my iphone application, i want to delete files automatically after a particular number of days from the creation of the file.The number of days after the file are to be deleted can be given by the user.I store the Date and Time of creation of 开发者_开发知识库file. How to perform this? All valuable suggestions are appreciated.Thanks.
Every time when user run the app you check with the date and delete the file by using
NSFileManager *fileManager = [NSFileManager defaultManager];
[fileManager removeItemAtPath:myPath error:NULL];
You could take a look at the [local] notification service, just handling the notification under the hood, without a user alert...
http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW4
精彩评论