我已经更新了 XCode 6.0.1、iOS 8.0 和之后使用UIAlertController
而不是UIAlertView
但标题UIAlertController
没有出现。参考见代码:
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"AlertView" message:@"Please Click" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action)
{
}];
UIAlertAction* cancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action)
{
[alert dismissViewControllerAnimated:YES completion:nil];
}];
[alert addAction:defaultAction];
[alert addAction:cancel];
[self presentViewController:alert animated:YES completion:nil];