Ios UIAlert未显示

Ios UIAlert未显示,ios,uialertview,Ios,Uialertview,这里有新鲜的新手。我刚开始编程,已经被UIAlert卡住了。我在这个网站上搜索过,但是有太多的帖子,正如我所说的,我对所有这些都有点陌生,所以我不知道到底要找什么。这就是我所拥有的 -(void)showError { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Please try again

这里有新鲜的新手。我刚开始编程,已经被UIAlert卡住了。我在这个网站上搜索过,但是有太多的帖子,正如我所说的,我对所有这些都有点陌生,所以我不知道到底要找什么。这就是我所拥有的

-(void)showError {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
                                                message:@"Please try again later. Have a nice day."
                                               delegate:nil
                                      cancelButtonTitle:@"Dismiss"
                                      otherButtonTitles:nil];
}
需要做

[alert show];
呈现

[警报显示]

我也总是忘记这件事。快乐编码

代码应为:

-(void)showError {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
                                                message:@"Please try again later. Have a nice day."
                                               delegate:nil
                                      cancelButtonTitle:@"Dismiss"
                                      otherButtonTitles:nil];
[alert show];
[alert release];
}
-(无效)淋浴器 {


}

您需要调用
[警报显示]
如果您想实际显示警报。在发布类似问题之前,请阅读
UIAlertView
的文档。您是否搜索过它;即使如此?因为有太多的问题和答案。并遵循@rmaddy的建议。:)
   UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
                                  message:@"Please try again later. Have a nice day."
                                  delegate:nil
                                  cancelButtonTitle:@"Dismiss"
                                  otherButtonTitles:nil];

   [alert show];