Question

I'm really stumped here.

_vc = [[VLCKitViewControlleriPhone alloc]initWithNibName:@"VLCKitViewControlleriPhone" bundle:nil];
_vc.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:_vc animated:YES completion:nil];

Gives me EXC_BAD_ACCESS (code = 2, address = 0x0) when the presentViewController method is called. The view controller is NOT nil. It also happens with or without a nib name. If I comment out the presentViewController line, the rest of the code continues fine, including method calls made to the view controller itself. The view controller is running, I just can't see anything because it's not actually showing the view.

I enabled NSZombies and tried it with Instruments running, but it's not showing me anything. The app just quits and instruments stops without giving me any information. Anyone know what the problem might be?

Was it helpful?

Solution

You can try this

if ([controller respondsToSelector:@selector(setModalPresentationStyle:)])
{
    [controller setModalPresentationStyle:UIModalPresentationFullScreen];
} else {
    [controller setModalPresentationStyle:UIModalPresentationFormSheet];
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top