iOS UISplitViewController委托方法永远不会被调用

时间:2014-06-19 12:55:45

标签: ios delegates uisplitviewcontroller

您好我正在开发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;
}

但它不适合我。那些方法永远不会被调用。难道我做错了什么。需要帮忙。谢谢。

0 个答案:

没有答案