【发布时间】:2014-10-08 09:14:36
【问题描述】:
我从 iOS8 和 Xcode 6.0.1 开始遇到问题,我的警报对话框的标题没有出现。所以我将我的 UIAlertView 更改为 UIAlertController 但我有同样的问题......
我的警报标题总是 nil 并且显示非常难看,因为我没有分隔线。
你知道我为什么会有这个吗?
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
谢谢。
【问题讨论】:
-
使用 Excat 相同的代码并在这里工作
-
@Bhumit 我在另一个干净的项目上进行了测试,它也可以正常工作,但我不知道在我的实际项目中可能与 UIAlertController 有什么冲突...
-
它在我身边工作
-
@Varsha 我也有一个新项目,但不是我当前的项目。我不知道为什么:/
标签: ios ios8 uialertview uialertcontroller