Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nickculbertson

macrumors regular
Original poster
Nov 19, 2010
226
0
Nashville, TN
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.