//向左滑动的时候的手势
UISwipeGestureRecognizer *leftSwipeGestureRecognizer = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(presentRightMenuViewController:)];
[leftSwipeGestureRecognizer setDirection:UISwipeGestureRecognizerDirectionLeft];
[self.view addGestureRecognizer:leftSwipeGestureRecognizer ];
//向右滑动时候的手势
UISwipeGestureRecognizer *rithSwipeGestureRecognizer = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(presentRightMenuViewController:)];
[rithSwipeGestureRecognizer setDirection:UISwipeGestureRecognizerDirectionRight];
[self.view addGestureRecognizer:rithSwipeGestureRecognizer ];
- (void)presentRightMenuViewController:(UISwipeGestureRecognizer *)dddd
{
[self.navigationController popViewControllerAnimated:YES];
}
那么问题来咯,现在返回上一个页面后,会崩溃,错误原因, -------待结果
2014-11-11 21:33:18.907 LYF_video[7979:258930] *** -[UIImageView superview]: message sent to deallocated instance 0x7fb2f3ea8870
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapClick)];
tap.numberOfTapsRequired = 1;
[self.view addGestureRecognizer:tap];
//点击一次的手势
- (void)tapClick
{
static BOOL flag = YES;
if (flag == YES) {
self.viewTitle.hidden = NO;
flag = NO;
}else{
self.viewTitle.hidden = YES;
flag = YES;
}
}