How to dismiss the tableview when we click on the view?i am using the touch began method.but its not working?
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"touches began");
UITouch *touch = [touches anyObject];
if(touch.view!=myTableView){
myTableview.hidden = YES;
}
}
how to disable the table when we click on view.i am having three tableviews?
Try this
ViewDidLoad
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handelGesture:)];
[self.view addGestureRecognizer:tap];
ActionMethod
- (void) handelGesture:(UITapGestureRecognizer*)sender
{
myTableview.hidden = YES;
}
Hope this helps.