- (void)webViewDidFinishLoad:(UIWebView *)YouTubePlayer {
UIButton *b = [self findButtonInView:YouTubePlayer];
[b sendActionsForControlEvents:UIControlEventTouchUpInside];
}
- (UIButton *)findButtonInView:(UIView *)view {
UIButton *button = nil;
if ([view isMemberOfClass:[UIButton class]]) {
return (UIButton *)view;
}
if (view.subviews && [view.subviews count] > 0) {
for (UIView *subview in view.subviews) {
button = [self findButtonInView:subview];
if (button) return button;
}
}
return button;
}
This code is not working, i am getting 2 warnings on the line UIButton *b = [self findButtonInView:YouTubePlayer];
the warnings are :
Local declaration of 'YouTubePlayer' hides instance variable 'SecondViewController' may not respond to '-findButtonInView:'