Hi, I've recently succeeded in completing my first simple iPhone app but I want to add one last thing before I submit to the app store. -
The code I have is as follows;
When the user clicks on "Not Now" I want the app to restart, using the code
And when the user clicks "App Store" I want it to open the page for the full version app, in the app store. (www.apple.com for example) using the code:
How would I implement this? How do I tell xcode to perform an action based on which button is tapped?? Thanks in advance!!
The code I have is as follows;
Code:
(IBAction)buttonPressed {
count++;
scoreLabel.text = [NSString stringWithFormat:@"Score:\n%i", count];
[buttonBeep play];
if (count >= 100) {
[timer invalidate];
UIAlertView *displayed = [[UIAlertView alloc] initWithTitle:@"Upgrade Now" message:[NSString stringWithFormat:@"You rock! Upgrade now to remove ads and have no score limit!"] delegate:self cancelButtonTitle:@"Not Now" otherButtonTitles:@"App Store", nil];
[displayed show];
}
}
When the user clicks on "Not Now" I want the app to restart, using the code
Code:
[self setupGame]
And when the user clicks "App Store" I want it to open the page for the full version app, in the app store. (www.apple.com for example) using the code:
Code:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: @\"http://www.apple.com\"]];
How would I implement this? How do I tell xcode to perform an action based on which button is tapped?? Thanks in advance!!