我试图在iPad的屏幕中间显示一个小控制器。
-(void)showDownloadDialog {
if (self.downloadDialogViewController == nil)
{
self.downloadDialogViewController = [[DownloadDialogViewController alloc] initWithNibName:@"DownloadDialogViewController" bundle:nil];
}
self.downloadDialogViewController.view.center = CGPointMake(SCREEN_WIDTH/2, SCREEN_HEIGHT/2);
if(LTIsPhone()) {
[self presentViewController:_downloadDialogViewController animated:NO completion:nil];
return;
}
if(_darkBackgroundView == nil)
{
_darkBackgroundView = [[UIView alloc] init];
_darkBackgroundView.backgroundColor = [UIColor colorWithWhite:0.1 alpha:0.5];
}
_darkBackgroundView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
self.downloadDialogViewController.view.center = CGPointMake(SCREEN_WIDTH/2, SCREEN_HEIGHT/2);
UIWindow *window = [[UIApplication sharedApplication] keyWindow];
[window addSubview:_darkBackgroundView];
[window addSubview:self.downloadDialogViewController.view];}
它确实出现了,但在我翻转iPad并尝试在屏幕上推动任何控件之后,发生了无法识别的选择器错误。我的IBActions无法找到。
-[__NSArrayM lowResButtonDidFire:]: unrecognized selector sent to instance 0x18a95770
当我presentViewController
一切正常时,但当我处理视图中添加的控制器时,就会发生崩溃。怎么解决?先感谢您。