Why isn't UIAlertView Showing?

前端 未结 4 1719
南笙
南笙 2021-01-06 11:12

For some reason screen gets dark and freezes, alert is not shown... can someone please help?

Thanks in advance!

} else {
    UIAlertView *alert = [[U         


        
4条回答
  •  我在风中等你
    2021-01-06 12:03

    Delegate is correct, but maybe because your do a release at the end it may cause a problem.

    Try with a nil delegate :-)

    For example :

    UIAlertView *alertView;
    alertView = [ [ UIAlertView alloc ] init ];
    [ alertView setMessage:@"Hello World" ];
    [ alertView show ];
    [ alertView release ];
    

    If it works, then it was the delegate and you need to declare the variable as a class var. Or it maybe be elsewhere.

提交回复
热议问题