uiwebview

set a delegate for UIWebView

懵懂的女人 提交于 2019-11-29 12:08:42
问题 How do I set a delegate for my UIWebView to use webViewDidFinishLoad ? 回答1: In the interface file indicate that you're interested: @interface SomethingController : UIViewController <UIWebViewDelegate> { Then in your implementation you'll add that delegate method: - (void)webViewDidFinishLoad:(UIWebView *)webView { // Do whatever you want here } Obviously SomethingController should be your actual controller, and UIViewController is whatever you're actually implementing. This, by the way, is

UIWebView leak? Can someone confirm?

 ̄綄美尐妖づ 提交于 2019-11-29 12:04:47
I was leak-testing my current project and I'm stumped. I've been browsing like crazy and tried everything except chicken sacrifice. I just created a tiny toy project app from scratch and I can duplicate the leak in there. So either UIWebView has a leak or I'm doing something really silly. Essentially, it boils down to a loadRequest: call to a UIWebView object, given an URLRequest built from an NSURL which references a file URL, for a file in the app bundle, which lives inside a folder that Xcode is including by reference. Phew. The leak is intermittent but still happens ~75% of the time (in

Stop Images from loading in UIWebView

↘锁芯ラ 提交于 2019-11-29 11:35:27
I have a website that I wish to load in a UIWebView, but it is full of images and takes ages to load. The images are useless, and only serve to reduce the usability on the iPhone. I dont own the website so I cannot change the site's actual code. The webpage is heavily linked in to the web with ASP.NET and AJAX (needs external files), so i dont think it is possible to have it load an HTML string. I want to stop the images from loading altogether. So how do i block them? Change the HTML code as its loading somehow, or block images from being loaded? I have 3 thoughts. Use a proxy to filter the

How to control page display to PDF loaded in UIWebView for iOS (go to page)

十年热恋 提交于 2019-11-29 10:41:18
问题 I'm developing an app which displays a PDF embedded in a WebView this is my code: - (void)viewDidLoad { [super viewDidLoad]; NSURL *urlremoto = [NSURL URLWithString:@"https://developer.apple.com/library/ios/documentation/userexperience/conceptual/TransitionGuide/TransitionGuide.pdf"]; request = [NSURLRequest requestWithURL:urlremoto]; [self.webView loadRequest:request]; [self.webView setScalesPageToFit:YES]; } -(void)webViewDidStartLoad:(UIWebView *)webView{ [self.activityIndicator

CGAffineTransformInvert: singular matrix

非 Y 不嫁゛ 提交于 2019-11-29 10:25:27
I've been occasionally seeing the error message: CGAffineTransformInvert: singular matrix In the logging area of Xcode. This seems to occur (infrequently, fortunately) when I pinch to resize a web site within a UIWebView. [Commercial website, not my own.] Since I do no Affine Transformations in my App, I'm wondering if this might be a bug/feature of UIWebView. If so, can I ignore it, since it doesn't seem to be interfering with anything? From looking around at other posts, it appears you'll get this message if you try and set the zoom scale to zero. Would be useful to NSLog the scale value

change content of uiwebview div object

五迷三道 提交于 2019-11-29 10:16:15
问题 is there any way to change the content of uiwebview in iphone application? by using div or else. my problem is that, to append data to uiwebview at any time. it think it can be done by replacing div content? 回答1: You can change like this [webview stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"document.getElementById('divtagId').innerHTML ='%@';",newContent]]; 来源: https://stackoverflow.com/questions/4459488/change-content-of-uiwebview-div-object

Loading NSData into a UIWebView

帅比萌擦擦* 提交于 2019-11-29 10:02:12
In my web browser, I am trying to load a UIWebView with NSData obtained from a NSURLConnection . When I try to load it into the UIWebView , instead of the site, it comes up with the HTML plain text. Here is my code: in viewDidLoad: NSURLRequest *request = [NSURLRequest requestWithURL: [NSURL URLWithString:@"http://www.msn.com"]]; [NSURLConnection connectionWithRequest: request delegate:self]; later in the code: -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { webdata = [NSMutableData dataWithData: data]; } -(void)connectionDidFinishLoading:(NSURLConnection *

Show keyboard in contenteditable UIWebView programmatically

心不动则不痛 提交于 2019-11-29 09:55:06
问题 My UIWebView loads a contenteditable html content. I want to let the UIWebView get focused and show keyboard in the UIWebView. I use [self.webview becomeFirstResponder] , but it doesn't work. Is there any work around method? Thanks. 回答1: UIwebview is not editable and you can not make it first responder. Where as you can use javascripts for that purpose , try out this answer UIWebView with contentEditable (html editing), first responder handling? 回答2: This is now possible in iOS 6. See the

Xcode Instrument : Memory Terms Live Bytes and Overall Bytes (Real Memory) confusion

北城以北 提交于 2019-11-29 09:39:13
问题 I am working on a Browser application in which I use a UIWebView for opening web pages. I run the Instruments tool with Memory Monitor. I am totally confused by the terms which are used in Instruments and why they're important. Please explain some of my questions with proper reasons: Live Bytes is important for checking memory optimization or memory consumption? Why ? Why would I care about the Overall Bytes/ Real Memory, if it contains also released objects? When and why are these terms used

UIWebView showing blank screen in iOS 8

こ雲淡風輕ζ 提交于 2019-11-29 09:36:41
I have an app where I can download a pdf and store it in the iPhone. It worked perfectly in iOS 7 (I am currently running on iOS 8) and while running the app in iOS 8, the webView just stays blank. I have I no idea what's wrong. #import "ISJMMisalViewController.h" #import "SWRevealViewController.h" @implementation ISJMMisalViewController @synthesize activityImageView; - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:YES]; [self.webView addSubview:activityImageView]; [activityImageView startAnimating]; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{