创建简单的UIAlertView时EXC_BAD_ACCESS

fri*_*iwi 2 iphone objective-c uialertview

在声明一个简单的UIAlertView时,使用以下代码,我在该行上得到了上面提到的错误:

UIAlertView * alerteken =  [[UIAlertView alloc] initWithTitle:@"Email" message:@"Please enter the @mailinator.com email address you want to read:" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok"];
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

May*_*jak 7

您需要提供一个以"nil"结尾的按钮标题列表:

otherButtonTitles:@"Ok",nil
Run Code Online (Sandbox Code Playgroud)