设置UIAlertViewStylePlainTextInput时,iOS7 UIAlertView EXC_BAD_ACCESS

时间:2015-02-03 15:07:03

标签: ios objective-c ios7 uialertview

我正在尝试使用输入字段显示UIAlertView for iOS 7设备,所以我有方法

- (void)createAlertView
{
    NSString *msg = @"Description (optional)";
    UIAlertView *myAlert  = [[UIAlertView alloc] initWithTitle:lastMarkAsOutdatedActionTitle
                                                   message:msg
                                                  delegate:self
                                         cancelButtonTitle:@"Cancel"
                                         otherButtonTitles:@"Confirm", nil];
    myAlert.alertViewStyle = UIAlertViewStylePlainTextInput;
    [myAlert show];
}

我正在这样打电话

[self performSelectorOnMainThread:@selector(createAlertView) withObject:nil waitUntilDone:NO];

但在第myAlert.alertViewStyle = UIAlertViewStylePlainTextInput;行我收到错误Thread 1: EXC_BAD_ACCESS (code=1, address=0x18)

我创建了干净的项目并测试了这段代码 - 它的工作原理让我坚持下去。有什么想法吗?

更新 错误时刻的屏幕 enter image description here enter image description here

0 个答案:

没有答案