Tag: sdcalertview

将自定义视图添加到警报视图

我有这样的问题: 我想在一个警报视图中显示一个自定义的视图。 所以我创build了一个单独的xib文件,并devise了我的界面,并为它实现了类。但是当我应用下面的代码时,它给了我一个错误。 这是代码: UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Confirm your Action" message:@"Click OK to confirm" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Cancel",nil]; NSArray *subviewArray = [[NSBundle mainBundle] loadNibNamed:@"customDialogViewController" owner:self options:nil]; customDialogViewController *myView = (customDialogViewController*) [subviewArray objectAtIndex:0]; [alert setValue:myView forKey:@"accessoryView"]; //alert.alertViewStyle = UIAlertViewStylePlainTextInput; alert.tag = KAlertViewthree; [alert show]; 这是我的错误: Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view […]