문제

Hi I am at my wits end with what I am doing wrong here. Has anyone experienced anything similar? I checked the apple developer forums, google, stack overflow and couldn't find anything.

MyViewController *myView;
myView = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil];
//or myView = [[MyViewController alloc]init];
UIPopoverController *popover;
popover = [[UIPopoverController alloc] initWithContentViewController:myView];  //always crash at here
//i've tried with some others ViewController but it's still crash.

Thanks so much.

도움이 되었습니까?

해결책

Assuming you're developing for iPad, try to give the popOver some frames, and try also to resize MyViewController nib, otherwise when it tries to load the view, it can't 'cause it's too big!

Something like

CGSizeMake(MyViewController.view.frame.size.width, MyViewController.view.frame.size.height);

Remember to resize it though

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top