Ios UIAlertView EXC\U坏访问(代码=EXC\U I386\U GPFLT)

Ios UIAlertView EXC\U坏访问(代码=EXC\U I386\U GPFLT),ios,objective-c,Ios,Objective C,我使用UIAlertView在iPhone6中显示警报。其中委托被称为nil。当我按下警报的ok按钮时,它会自动崩溃,并且没有错误消息。它只显示EXC\u坏访问(code=EXC\u I386\u GPFLT) 鉴于以下代码: UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"" message:@"This First ALert" delegate:nil cancelButtonTitle:@"Ok" otherButtonTit

我使用
UIAlertView
在iPhone6中显示警报。其中委托被称为nil。当我按下警报的ok按钮时,它会自动崩溃,并且没有错误消息。它只显示
EXC\u坏访问(code=EXC\u I386\u GPFLT)

鉴于以下代码:

UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"" message:@"This First ALert" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[alert show]; 
请检查一下

UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"" message:@"This First  ALert" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alert show]; 

谢谢:)

您刚刚在
otherButtonTiles

UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"" message:@"This First ALert" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alert show]; 

跳过此选项有帮助。

如果您没有传递任何
其他按钮标题
,则在方法调用结束时,只有一个
nil
就足够了:)请阅读此问答链接: