开发者

Auto play youtube error?

    - (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 (UIBut开发者_开发技巧ton *)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:'


  1. You should call [YouTubePlayer view] in the findButtonInView-method.
  2. In your SecondViewController.h-file, add the line - (UIButton *)findButtonInView:(UIView *)view;.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜