0

i want to add a Alert view with information after a update , what is new in the new app version!

i use this code :

BOOL isRunMoreThanOnce = [[NSUserDefaults standardUserDefaults] boolForKey:@"isRunMoreThanOnce"];
if(!isRunMoreThanOnce){
        // Show the alert view

        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Achtung" message:@"Version 1.5" delegate:self cancelButtonTitle:@"OK..!" otherButtonTitles:nil, nil];
        [alert show];
        // Then set the first run flag
        [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"isRunMoreThanOnce"];
        [[NSUserDefaults standardUserDefaults] synchronize];
}

but this alert shows only once by the first start, how can i check the bundle version, and show the alert by the first start after update it!

thanks for your help

Heisenberg
  • 113
  • 1
  • 8

1 Answers1

1

I would save the current app version number in NSUserDefaults then when you update the app check the new version number with the saved one.

to get the app version number you can use the following

NSString * appVersionString = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];

Refer to this question for more details

Community
  • 1
  • 1
Kaiusee
  • 1,253
  • 1
  • 14
  • 28