0

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];
4

1 に答える 1