Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UIButton点击崩溃应用程序_Ios_Uibutton - Fatal编程技术网

Ios UIButton点击崩溃应用程序

Ios UIButton点击崩溃应用程序,ios,uibutton,Ios,Uibutton,我有一个错误警报视图,当我单击“确定”时崩溃 此alertView位于自定义ErrorAlert:UIView中 此警报显示良好 然而,当点击“确定”按钮时,应用程序崩溃,它从未到达 -(作废)dismissError:(id)发件人 我是否在错误的位置添加了按钮?(它提供了通用的int-retVal=……EXC\u BAD\u访问)除非在外部显示器上显示某些内容,否则不应创建新的UIWindow 在iOS中,窗口没有标题栏、关闭框或任何其他视觉装饰。窗口始终只是一个或多个视图的空白容器。此外,

我有一个错误警报视图,当我单击“确定”时崩溃

此alertView位于自定义ErrorAlert:UIView中

此警报显示良好

然而,当点击“确定”按钮时,应用程序崩溃,它从未到达 -(作废)dismissError:(id)发件人


我是否在错误的位置添加了按钮?(它提供了通用的int-retVal=……EXC\u BAD\u访问)

除非在外部显示器上显示某些内容,否则不应创建新的UIWindow

在iOS中,窗口没有标题栏、关闭框或任何其他视觉装饰。窗口始终只是一个或多个视图的空白容器。此外,应用程序不会通过显示新窗口来更改其内容。如果要更改显示的内容,请改为更改窗口最前面的视图


看看

除非在外部显示器上显示某些内容,否则不应创建新的UIWindow

在iOS中,窗口没有标题栏、关闭框或任何其他视觉装饰。窗口始终只是一个或多个视图的空白容器。此外,应用程序不会通过显示新窗口来更改其内容。如果要更改显示的内容,请改为更改窗口最前面的视图


看看

您是否尝试打开NSZombies来检查哪个释放实例接收到消息?是的。这就解决了问题。自动释放在单击之前打勾。您是否尝试打开NSZombies以检查哪个释放实例收到消息?是。这就解决了问题。自动释放在单击之前打勾。
- (id)initWithFrame:(CGRect)frame {
if ((self = [super initWithFrame:frame])) {
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setTitle:@"OK" forState:UIControlStateNormal];
    [button setFrame:CGRectMake(10, 80, 266, 43)];  
    [button addTarget:self action:@selector(dismissError:) forControlEvents:UIControlEventTouchUpInside];
    [alertView addSubview:button]; //This is a subview of 
    //...other stylings for the custom error alert view

    errorWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    errorWindow.windowLevel = UIWindowLevelStatusBar;
    errorWindow.hidden = NO;        
    [errorWindow addSubview:alertView];
    [errorWindow makeKeyAndVisible];

}