iOS: how to find application installation date and update date programmatically
I am developing one application in that I want to find application installation date on my device and开发者_C百科 when update happen that date and time as programmatically.
Not sure if you can find an application installation date but you could save the current date when the application is first ran. Something like this should do the trick
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
if (![prefs objectForKey:@"installation_date"]) {
NSDate *now = [NSDate date];
[prefs setObject:now forKey:@"installation_date"];
}
(This code is untested)
精彩评论