My structure of views:
UITableView
UITableViewCell
UIScrollView
CustomView
UIButton
The problem is UIButton doesn\'t wo
Came across the same scenario. UIScrollView in separate class and adding button through a custom view. 'NSNotificationCenter' helped me solving the issue. Sample code:
-(void)tileTouchUpInside:(id)sender
{
NSDictionary *dict=[NSDictionary dictionaryWithObject:@"index" forKey:@"index"];
[[NSNotificationCenter defaultCenter]postNotificationName:@"Action" object:nil userInfo:dict];
}
In the class containing Scroll View:
- (void)viewDidLoad
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(doAction:) name:@"Action" object:nil];
}
-(void)doAction:(NSNotification *) notification
{
NSString* value =[notification.userInfo valueForKey:@"index"];
// .......
}
Enable userInteraction for scroll view, custom view and button.
I had same issue & same hierarchy of the views, With latest sdk , just use it :
Setting delaysContentTouches to NO for UIButton in the same UITableViewCell.
self.tableView.delaysContentTouches = NO