title: app crashing in doing slide menu in ios
body: <p>I am doing slide menu like Facebook in iOS a simple app I where doing step by step process from tutorial which available in this link <a href="http://www.raywenderlich.com/32054/how-to-create-a-slide-out-navigation-like-facebook-and-path" rel="nofollow">http://www.raywenderlich.com/32054/how-to-create-a-slide-out-navigation-like-facebook-and-path</a>
  . I am only doing right panel slide when I click button it moving slide happening but when I call my main view again it is happening but app getting crash could any one help me to get out from this problem</p>
  
  <pre><code>#define RIGHT_PANEL 2
  #define CENTRAL_TAG 1
  #define SLIDE_TIMING .25
  #define PANEL_WIDTH 60
  @interface MainViewController ()&lt;CenterViewControllerDelegate&gt;
  
  
  
  @property(nonatomic,strong)CentralViewController *centralView;
  @property(nonatomic,strong)RightViewController *RightView;
  
  @property (nonatomic, assign) BOOL showingRightPanel;
  
  -(UIView*)getright;
  -(UIView*)resetmainView;
  @end
  
  
  
  @implementation MainViewController
  
  
  
  - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
  {
      self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
      if (self) {
          // Custom initialization
      }
      return self;
  }
  
  
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      self.centralView = [[CentralViewController alloc] initWithNibName:@"CentralViewController" bundle:nil];
  
      self.centralView.view.tag = CENTRAL_TAG;
  
      self.centralView.delegate=self;
  
  
      [self.view addSubview:self.centralView.view];
      [self addChildViewController:_centralView];
  
      [_centralView didMoveToParentViewController:self];
  
  
  
  
  }
  -(UIView*)getright
  {
  
  if(_RightView==Nil)
      {
          self.RightView=[[RightViewController alloc]initWithNibName:@"RightViewController" bundle:Nil];
  
          self.RightView.view.tag=RIGHT_PANEL;
          self.RightView.delegate=self;
          [self.view addSubview:self.RightView.view];
          [self addChildViewController:self.RightView];
          [_RightView didMoveToParentViewController:self];
  
          _RightView.view.frame=CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
  
      }
      self.showingRightPanel=YES;
      UIView *view=self.RightView.view;
      return view;
  }
  
  -(void)MovetoOriginal
  {
      [UIView animateWithDuration:SLIDE_TIMING delay:0 options:UIViewAnimationOptionBeginFromCurrentState
                       animations:^{
                           _centralView.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
                       }
                       completion:^(BOOL finished) {
                           if (finished) {
  
                               [self resetmainView];
                           }
                       }];}
  
  -(void)rightpanelmove
  {
      UIView *child=[self getright];
      [self.view sendSubviewToBack:child];
  
      [UIView animateWithDuration:SLIDE_TIMING delay:0 options:UIViewAnimationOptionBeginFromCurrentState
                       animations:^{
                           _centralView.view.frame = CGRectMake(-self.view.frame.size.width + PANEL_WIDTH, 0, self.view.frame.size.width, self.view.frame.size.height);
                       }
                       completion:^(BOOL finished) {
                           if (finished) {
  
                               _centralView.rightbutton.tag = 1;
                           }
                       }];
  
  }
  
  
  -(UIView*)resetmainView
  {
      if(_RightView!=Nil)
      {
          [self.RightView.view removeFromSuperview];
          self.RightView=Nil;
          _centralView.rightbutton.tag=0;
          self.showingRightPanel=NO;
      }
  </code></pre>
  
  <p>This is my main control code where am calling the event</p>
  
  <p>And this one is button action code</p>
  
  <pre><code>- (IBAction)btnright:(id)sender {
  
      UIButton *button = sender;
      switch (button.tag) {
          case 0: {
              [_delegate rightpanelmove];
              break;
          }
  
          case 1: {
  
               [_delegate MovetoOriginal];
              break;
          }
  
          default:
              break;
      }} 
  </code></pre>