gpt4 book ai didi

ios - UIAlertView 按钮 Action ?

转载 作者:技术小花猫 更新时间:2023-10-29 11:10:14 24 4
gpt4 key购买 nike

我有一个 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com