title: ios protocol not functioning properly
body: <pre><code>//AddSideBarProtocol.h
  @protocol AddSideBarProtocol  &lt;NSObject&gt;
  
  - (IBAction)barButtonTapped:(id)sender;
  
  @end
  </code></pre>
  
  <p>I am creating above protocol to use in all my view controllers.
  My implementation for this protocol is as follows:</p>
  
  <pre><code>//AddVehicleViewController.m
  - (IBAction)barButtonTapped:(id)sender{
  [self.view endEditing:YES];
  [lblToolBarTitle setText:@"Vehicle Management"];
  
  tblViewSideBar = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, 200, self.view.frame.size.height-44)];
  tblViewSideBar.delegate = self;
  tblViewSideBar.dataSource = self;
  tblViewSideBar.separatorStyle = UITableViewCellSeparatorStyleNone;
  [tblViewSideBar setBackgroundColor:[UIColor lightGrayColor]];
  
  btnToClose = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
  [btnToClose setBackgroundColor:[UIColor clearColor]];
  [btnToClose addTarget:self action:@selector(dismissView:) forControlEvents:UIControlEventTouchUpInside];
  
  addSideBarView = [[UIView alloc]initWithFrame:CGRectMake(0, 44, 200, self.view.frame.size.height)];
  [addSideBarView setBackgroundColor:[UIColor blackColor]];
  
  addSideBarView.frame = CGRectMake(-200, 44, 200, self.view.frame.size.height);
  
  [UIView animateWithDuration:0.5
                        delay:0.0
                      options:UIViewAnimationOptionCurveEaseInOut
                   animations:^ {
                       addSideBarView.frame = CGRectMake(0, 44, 200, self.view.frame.size.height);
                   }
                   completion:nil];
  
  [self.view addSubview:btnToClose];
  [self.view addSubview:addSideBarView];
  [addSideBarView addSubview:tblViewSideBar];
  
  }
  </code></pre>
  
  <p>And I am calling the protocol from another view controller named "MaintenanceViewControlle" using following lines of code::</p>
  
  <pre><code>AddVehicleViewController *addVehicle = [[AddVehicleViewController alloc] init];
  
  id &lt;AddSideBarProtocol&gt; addSide;
  addSide = addVehicle;
  
  [addSide barButtonTapped:sender];
  </code></pre>
  
  <p>But This protocol is not functioning properly, so where am I lacking ??</p>