I can call properly "toggleMasterVisible" method as a Button action but I want to expand the method like this.
(In Button action. It works)
.h
@interface DetailViewController : UIViewController <UISplitViewControllerDelegate>
@end
.m
UIBarButtonItem *listBarButtonItem = [[UIBarButtonItem alloc]
initWithImage:[UIImage imageNamed:@"list.png"]
style:UIBarButtonItemStyleBordered
target:self.splitViewController
action:@selector(toggleMasterVisible:)];
(I want to expand the method)
.m
UIBarButtonItem *listBarButtonItem = [[UIBarButtonItem alloc]
initWithImage:[UIImage imageNamed:@"list.png"]
style:UIBarButtonItemStyleBordered
target:self
action:@selector(toggleMasterVisibleIfCondtionIsOK:)];
-(void)toggleMasterVisibleIfCondtionIsOK
{
if(isConditionOK){
[self.splitViewController toggleMasterVisible];
}
}
However, I got an error which is "No visible @interface for 'UISplitViewController' declares". Where is the method defined? I could not find the method on the reference(http://developer.apple.com/library/ios/#documentation/uikit/reference/UISplitViewController_class/Reference/Reference.html) and how can I call the method? Any help will be appreciated.