我尝试通过UIPopover加载视图,但我的应用程序崩溃后点击弹出按钮,我试图解决它,但我不明白!这是我的代码:
-
(IBAction)calendarPopUp:(id)sender {
PopViewController *cal = [[PopViewController alloc]init];
//The compiler tells me the problem comes from this line :
UIPopoverController *popOver = [[UIPopoverController alloc] initWithContentViewController:cal];
[popOver setDelegate:self];
[popOver presentPopoverFromRect:CGRectMake(113, 64, 226, 129) inView:self permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES];
[popOver setPopoverContentSize:CGSizeMake(226, 129)];
}
答案 0 :(得分:1)
我猜您应该将inView:self
更改为inView:self.view
。