开发者

add SplitViewController view trouble under iOS5

When I trying to add SplitViewController to view hierarchy application terminates with:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIPopoverController initWithContentViewController:] must not be called with nil.'

SplitViewController *viewCont开发者_Python百科roller = [[SplitViewController alloc] init];
[self.window addSubview:viewController.view];

Where SplitViewController subclass of UISplitViewController

I don't understand which popover it means. This trouble appear only on iOS5.


After initializing viewController, you should set its viewControllers with viewController.viewControllers = [NSArray arrayWithObjects:leftNavigationController, rightNavigationController, nil];

Else, your SplitViewController does not know what to display on the left and on the right.

Pay attention also to the delegate.

Please check if this helps :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜