Gil O.
Gil O.

Reputation: 123

UIWebView is crashing when trying to load a local html file

The code I am using in my view controller viewDidLoad method:

NSString *path = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"html"];
NSURL *url = [NSURL fileURLWithPath:path];
NSURLRequest* request = [[NSURLRequest requestWithURL:url] autorelease];
[webView loadRequest:request];

I get EXE_BAD_ACCESS

Upvotes: 1

Views: 310

Answers (1)

Deepak Danduprolu
Deepak Danduprolu

Reputation: 44633

requestWithURL: will give you an autoreleased object so you don't need to autorelease it again.

Upvotes: 2

Related Questions