uiwebview

UIWebView: Error while loading URL

梦想的初衷 提交于 2019-12-19 19:52:11
问题 I am trying to build an RSS reader for the Tom's Hardware website. I have an error when I try to load an URL into an UIWebview from an RSS link. Here'is my code: - (void)viewDidLoad { [super viewDidLoad]; if (self.url != nil) { NSURL *requestUrl = [NSURL URLWithString:self.url]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:requestUrl]; [webView loadRequest:requestObj]; } } The url is setted by the parent controller. When the URL comes directly from the RSS, I have an error in log:

iOS UIWebView app opens link in Safari

寵の児 提交于 2019-12-19 18:57:24
问题 I have an iOS app which has only one view and that is UIWebView (It opens the main content of the app). I would like when I make a click somewhere(e.g on a table row) the app to opens specific link in Safari browser not inside the UIWebView. Is that doable without writing any iOS code and instead of that make the JavaScript opens that link in Safari itself ? I have thatcode,but it doesn't help at all: HTML Code <tr class='link-to-pdf' data-href='www.example.com'> JS Code: $(".link-to-pdf")

Trouble hiding iAd banner and displaying UIWebView in its place

♀尐吖头ヾ 提交于 2019-12-19 12:28:58
问题 When there is no iAd banner to display, we would like to display a UIWebView of the same dimensions pointed to a specific URL. However, hiding the iAd banner and showing the UIWebView doesn't work. We embed the show/hide code inside bannerViewDidLoadAd and didFailToReceiveAdWithError . All that appears is the white, blank rectangle when there is no iAd inventory instead of our UIWebView. If a user clicks on a link inside the UIWebView, we would like the link to open in Safari. Do we need to

(lots of) UIWebView memory leaks

余生颓废 提交于 2019-12-19 12:08:37
问题 I've seen from other posts that there are memory leaking issues with UIWebView. However, with the amount of objects that I have leaking, I have to wonder if I'm doing something wrong. 'Leaks' reports about 60 leaks for opening a UIWebView, loading a page and closing (it's the Facebook login page). I've check the stack trace for every one of these objects, and they never touch my code. They're all either in a separate thread (I only use the main thread), or go from 'main' to a bunch of

(lots of) UIWebView memory leaks

白昼怎懂夜的黑 提交于 2019-12-19 12:08:08
问题 I've seen from other posts that there are memory leaking issues with UIWebView. However, with the amount of objects that I have leaking, I have to wonder if I'm doing something wrong. 'Leaks' reports about 60 leaks for opening a UIWebView, loading a page and closing (it's the Facebook login page). I've check the stack trace for every one of these objects, and they never touch my code. They're all either in a separate thread (I only use the main thread), or go from 'main' to a bunch of

Downloading image into bundle?

百般思念 提交于 2019-12-19 12:02:53
问题 I display text and images in a UIWebView. Content isn't always the same. I access images within the content using the bundle path. For an inbetween versions update of content, I'd like to allows users the ability to download new content (text & images). This new content will also display in a UIWebView. The problem is I will have to use a disk path rather than my common pattern of using the bundle path. Unless there is a way to repackage the image at runtime into the bundle. Once the next app

Why PDF not opening in iFrame in Chrome when switched to Mobile Device Mode

陌路散爱 提交于 2019-12-19 11:19:04
问题 This shows the pdf when we open it in browser. <html> <head> </head> <body> <iframe src="https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/44678.pdf" width="100%" height="100%" > </iframe> </body> </html> But when I switch it to mobile view, it DOESNT work. Steps: Open Chrome Inspect Window. Click "Toggle Device Toolbar" icon on the top menu on inspect window toolbar. Now we can still see the pdf in mobile view. Once we refresh it, we can NO LONGER SEE pdf. Why ?

How UIWebView detect <img src=“…” /> is tapped

假如想象 提交于 2019-12-19 10:56:56
问题 I know that method below can detect a link element tap. But I want to know if the UIView can detect if the img element is tapped? - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{ switch (navigationType) { case UIWebViewNavigationTypeLinkClicked: NSLog(@"link is click"); //do something break; default: break; } return true; } Some html source like below: <p>xxxxxxxxx</p> <p><img src="http://imgs.ebrun

how to use javascript in uiwebview to get the clicked button id?

試著忘記壹切 提交于 2019-12-19 10:17:00
问题 This Time i want to know how to determine which button is click in UIWebView..... appDelegate.mystring = [[NSMutableString string]init]; NSString *buttonstring=@"<label><input type=\"submit\" name=\"button\" id=\"1\" value=\"Delete\" /></label>"; for (int i=0; i<appDelegate.lyricsData.count; i++) { NSString *b= @"<br>"; NSString *st1=[[appDelegate.lyricsData objectAtIndex:i] objectForKey:@"user_name"]; appDelegate.mystring=[appDelegate.mystring stringByAppendingString:st1]; appDelegate

RTF equivalent to UIWebView's loadHTMLString?

空扰寡人 提交于 2019-12-19 10:12:48
问题 Since OS 3.0 UIWebView supports RTF files. If you have a .rtf file, it's easy enough to load it into a uiwebview, e.g. NSString *path = [[NSBundle mainBundle] pathForResource:documentName ofType:nil]; NSURL *url = [NSURL fileURLWithPath:path]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [webView loadRequest:request]; When loading HTML stored in a string variable, you can use loadHTMLString . How would one load RTF stored in a string directly into a UIWebView ? For example, if