I've encountered a strange problem, when it comes to displaying a page in a UIWebView on iPhone SDK 4.0.
I load a page with a .aspx-request and receive completely valid html-sourcecode. Inside the html is an email-address linked like this:
<a href="mailto:[email protected]">[email protected]</a><br />
When I activate the link-detection in the UIWebView, I got an exception:
-[DOMHTMLElement setHref:]: unrecognized selector sent to instance 0x5a6dc70
2010-07-26 16:13:09.292 MyApp[23818:2103] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DOMHTMLElement setHref:]: unrecognized selector sent to instance 0x5a6dc70'
Now what is strange about this issue? When I take exactly the same html-sourcecode, that is returned by the request, save it locally to a .html-file and load it from there with UIWebKit, everything works like a charm like it should. Anyone got an idea, why this is the case?
Btw: I create the request like that in the source-code:
NSURL* url = [NSURL URLWithString:@"http://my.tld.com/path/site.aspx"];
// alternate request: this works!
//NSURL* url = [NSURL URLWithString:@"file:///Users/user/Desktop/site.html"];
NSURLRequest* request = [NSURLRequest requestWithURL:url];
myWebView.delegate = self;
[myWebView loadRequest:request];