自 iOS8 和 Xcode 6.0.1 以来我遇到了一个问题,我的警告对话框的标题没有出现。所以我将 UIAlertView 更改为 UIAlertController 但我遇到了同样的问题......
我的警报标题总是为零,而且显示非常难看,因为我没有分隔线。
你知道我为什么会有这个吗?
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"title" message:@"message" preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[self dismissViewControllerAnimated:YES completion:nil];
}]];
[self presentViewController:alert animated:YES completion:nil];
但这是结果
(lldb) po alert.title
nil
(lldb) po alert.message
message
谢谢。
最佳答案
感谢@Myaaoonn,我解决了我的问题!
UIAlertView title does not display
I have just Remove the following method from my ViewController Category Class And its working fyn!
- (void)setTitle:(NSString *)title
{
// My Code
}
关于ios - iOS8 的 UIAlertController 标题始终为 nil,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26253231/