UIWebView and Youtube

Discussion in 'iOS Programming' started by nickculbertson, Feb 9, 2011.

  1. nickculbertson macrumors regular

    nickculbertson

    Joined:
    Nov 19, 2010
    Location:
    Nashville, TN
    #1
    Hello,
    I've set up a UIWebView named webView. I can load the webView in a second view but when I return to my main view and then back to my second view, the app crashes EXC BAD ACCESS. After looking online I found that the problem seems to occur only when I use a youtube URL. Does anyone have a solution?

    my .h
    Code:
    @interface SecondView : UIViewController <UIWebViewDelegate> {
    IBOutlet UIWebView *webView;
    }
    - (IBAction)backview; 
    
    @property (nonatomic, retain) IBOutlet UIWebView *webView;
    @end
    
    my .m
    Code:
    @synthesize webView;
    
    - (void)viewDidLoad {
    	
        
    	[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.youtube.com/user/nickculbertson"]]];
    	
    	[super viewDidLoad];
    	
    	 
    }
    - (void)dealloc {
    	webView.delegate = nil;
        [webView stopLoading];
        [webView release];
    
    	[super dealloc];
    }
    Thanks,
    Nick
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #2
    Run in Instruments with zombies enabled.
     
  3. nickculbertson thread starter macrumors regular

    nickculbertson

    Joined:
    Nov 19, 2010
    Location:
    Nashville, TN
    #3
    Thanks for the response. Zombie didn't return any results. I think it may have something to do with youtube because it loads and reloads fine with other sites.
     

Share This Page