【发布时间】:2011-10-03 02:02:56
【问题描述】:
我对 UIAlertView 的编程有点陌生。我想到的是做一个弹出窗口,在应用程序启动时显示除了默认的关闭按钮之外还有两个按钮。 其中一个按钮是指向应用商店的链接,另一个按钮是永远关闭该弹出窗口。 除了最后一个按钮,我已经完成了所有操作。 有什么帮助吗?
谢谢!
- (void)viewDidLoad {
alert = [[UIAlertView alloc] initWithTitle:@"Rate!" message:@"Your rate is much apreciated" delegate:self cancelButtonTitle:@"Not Now" otherButtonTitles:@"Okay! ", @"No, Thanks!", nil ];
[alert show];
[alert release];
}
-(void)alertView:(UIAlertView *) alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 0) {
}
if (buttonIndex == 1) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://itunes.apple.com/pt/app/designertools/id444778173?mt=8#" ]];
}
}
【问题讨论】:
-
取消按钮不需要任何特殊设置或任何东西。当你点击它时会发生什么?
标签: iphone xcode popup uialertview dismiss