解决方法
如果您询问是否要查找应用程序通过应用商店更新的时间,我不知道这样的方法.
执行此操作的hackie方法是将当前应用程序版本保存到NSUserDefaults,然后检查NSUserDefaults应用程序版本是否等于当前应用程序版本.
例如:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSString *currentAppVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]; if ([defaults objectForKey:@"savedAppVersionKey"] != nil) { //key exists NSString *savedAppVersion = [[NSUserDefaults standardUserDefaults] objectForKey:@"savedAppVersionKey"]; if ([currentAppVersion isEqualToString:savedAppVersion]) { //still running the same app version } else { //the app version changed from the last launch } } else { //first run,set the key & synchronize [[NSUserDefaults standardUserDefaults] setObject:currentAppVersion forKey:@"savedAppVersionKey"]; [[NSUserDefaults standardUserDefaults] synchronize] } }
我没有测试过代码,但它应该可以工作.
谢谢,
-大卫