我有使用 “UIAlertController” 在iOS 8及更高版本。让我们看到:
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Success" message:@"Your InApp Purchases were successfully restored" preferredStyle:UIAlertControllerStyleAlert];
并添加按钮:
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
//do something when click button
}];
记住:
[alertController addAction:okAction];
然后告诉它:
[self presentViewController:alertController animated:YES completion:nill];
如果你想显示actionsheep,你更改
"preferredStyle:UIAlertControllerStyleActionSheet"
任何原因,你没有简单地看在'UIAlertView'(它告诉你到底该怎么做)的文档中,或者在发布这个问题之前做一个搜索?请在发布前尝试找到答案。 – rmaddy
如果您在他们的文档中找不到答案,请将您的项目更好地转移到iOS 8.:P –