创建简单的UIAlertView时EXC_BAD_ACCESS

时间:2010-08-19 13:59:35

标签: 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"];

我做错了什么?

1 个答案:

答案 0 :(得分:7)

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

otherButtonTitles:@"Ok",nil