我有一个 UIAlertView
,它显示了这段代码,要求您对应用程序商店中的应用程序进行评分。
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Rate on the Appstore!"
message:@""
delegate:self
cancelButtonTitle:@"Later"
otherButtonTitles:@"OK", nil];
[alert show];
[alert release];
但我不知道如何向将您带到 AppStore 中的应用程序的“确定”按钮添加操作。
最佳答案
这个怎么样?
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex != [alertView cancelButtonIndex]) {
NSLog(@"Launching the store");
//replace appname with any specific name you want
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.com/apps/appname"]];
}
}
关于ios - UIAlertView 按钮 Action ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10255455/