您好我正在开发IOS应用程序,我正在尝试使用UISplitViewControllerDelegate
的委托方法。但这些方法永远不会被调用。
我做了以下事情。
详细视图控制器:
@interface DetailViewController : UIViewController<UISplitViewControllerDelegate>
@end
和
- (void)viewDidLoad
{
[super viewDidLoad];
splitController.delegate = self;
// Do any additional setup after loading the view.
}
我尝试访问以下方法:
-(void)splitViewController:(UISplitViewController *)svc
willHideViewController:(UIViewController *)aViewController
withBarButtonItem:(UIBarButtonItem *)barButtonItem
forPopoverController:(UIPopoverController *)pc
{
NSLog(@"Will hide left side");
}
-(void)splitViewController:(UISplitViewController *)svc
willShowViewController:(UIViewController *)aViewController
invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem
{
NSLog(@"Will show left side");
}
- (BOOL) splitViewController:(UISplitViewController *)svc
shouldHideViewController:(UIViewController *)vc
inOrientation:(UIInterfaceOrientation)orientation
{
NSLog(@"should hide view controller ");
return NO;
}
但它不适合我。那些方法永远不会被调用。难道我做错了什么。需要帮忙。谢谢。