我有一个完美的工作项目,直到我更新到ios6.
当我在一个条形项上选项卡显示一个带有视图的弹出窗口时应用程序崩溃…
这是我得到的错误
"reason: 'A view can only be associated with at most one view controller at a time! View <UIView: 0xaa7d730; frame = (20 0; 748 1024); autoresize = RM+BM; layer = <CALayer: 0xaa7d790>> is associated with <TYOFormViewController: 0xaa7d8b0>. Clear this association before associating this view with <TYOFormViewController: 0x14c68a70>.'"
这是声明UIViewController和UIPopoverController的方法.
- (IBAction)TestDriveTapped:(id)sender{ if (PopoverController != nil) { [PopoverController dismissPopoverAnimated:YES]; self.PopoverController = nil; } if (self.PopoverController == nil) { UIViewController *bookTestDrive =[[TYOFormViewController alloc] initWithNibName:@"TYOBookTestDriveForm" bundle:nil]; UIPopoverController *poc = [[UIPopoverController alloc] initWithContentViewController:bookTestDrive]; [poc presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; self.PopoverController = poc; } else { if (PopoverController != nil) { [PopoverController dismissPopoverAnimated:YES]; self.PopoverController = nil; } }
}
错误说我必须清除与TYOFormViewController的关联,以将它与TYOFormViewController关联….这是怎么发生的?
非常喜欢你对这个问题的帮助… jstuck整天都在用它…
谢谢