uiwebviewdelegate

Avoid UIWebView load iTunes App

*爱你&永不变心* 提交于 2020-02-24 12:00:37
问题 How to avoid an UIWebView from opening the iTunes App when loading an iTunes URL? Example URL: http://itunes.apple.com/nl/app/bluppr-postcards/id348147229?mt=8 Above URL loads the iTunes App directly. UIWebViewDelegate doesn't seem to be able to control this to just load the page in the UIWebView. It seems it's controlled by the JavaScript function detectAndOpenItunes(); in the body tag of the page. Any ideas? 回答1: You're right that the relevant function is detectAndOpenItunes(), which is

Get the http response code from every UIWebView request

烈酒焚心 提交于 2020-01-22 15:03:47
问题 I need to check the response status code while loading any of the url in the webview fo. For now we can consider any of the web application I am loading inside the web view.So I need to track down every request withing that webview and check out the response code accordingly. For finding the response code, I need to use NSUrlConnection inside the uiwebview's delegate method "shouldStartLoadWithrequest". Some thing like this - - (BOOL) webView:(UIWebView *)webView shouldStartLoadWithRequest:

UIWebViewDelegate methods not getting called

烈酒焚心 提交于 2020-01-11 09:20:48
问题 I want to use UIWebViewDelegate methods. I set its delegate to self but still not working -(void)webViewDidStartLoad:(UIWebView *)webView { NSLog(@"Load view"); } -(void)webViewDidFinishLoad:(UIWebView *)webView { NSLog(@"Finish View"); } -(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { NSLog(@"Error in loading: %@", [error description]); } 回答1: Do not write anything in viewDidLoad . Try putting webview related code viewDidAppear or any custom method. Cross check if

Is is possible to communicate between UINavigationController and web page loaded inside UIWebView?

◇◆丶佛笑我妖孽 提交于 2020-01-07 05:35:34
问题 I am new to iOS development. I will try my best to explain my question, please pardon me if you find it silly. I was wondering if one can load a subview in a UINavigationController by clicking a link inside a UIWebView. Explaining it further, let's say there is UINavigationController that has a subview and that subview has a UIWebView called A, and there is another subview(that is not loaded yet) called B. Is is possible to load B (or perform any other native Objective C event) when user taps

How to create then destroy a UIWebView inside a class file

痴心易碎 提交于 2020-01-06 06:49:10
问题 I am trying to dynamically create a UIWebView inside a class file upon launching the application. I have successfully gotten a function to be called inside that class file upon launching, but when I add the the code to create the webview to that function, I am getting errors like this: " Tried to obtain the web lock from a thread other than the main thread or web thread. This may be the result of calling to UIKit from a secondary thread. Crashing now... " My code to create the UIWebView is

uiwebview not loading request even with delegate = self

回眸只為那壹抹淺笑 提交于 2020-01-03 16:44:22
问题 I have created a NSObject class and included , in the init i create a uiwebview set the delegate to self and send the load request. For some reason webViewDidFinishLoad or didFailLoadWithError never get fired. I can't figure why. // // RXBTest.h #import <Foundation/Foundation.h> @interface RXBTest : NSObject <UIWebViewDelegate> @end // RXBTest.m // pageTest #import "RXBTest.h" @implementation RXBTest - (id) init { if((self=[super init])){ UIWebView* webView = [[UIWebView alloc] initWithFrame

uiwebview not loading request even with delegate = self

给你一囗甜甜゛ 提交于 2020-01-03 16:44:05
问题 I have created a NSObject class and included , in the init i create a uiwebview set the delegate to self and send the load request. For some reason webViewDidFinishLoad or didFailLoadWithError never get fired. I can't figure why. // // RXBTest.h #import <Foundation/Foundation.h> @interface RXBTest : NSObject <UIWebViewDelegate> @end // RXBTest.m // pageTest #import "RXBTest.h" @implementation RXBTest - (id) init { if((self=[super init])){ UIWebView* webView = [[UIWebView alloc] initWithFrame

Detect and Customize UIWebView's “Unable to Read Document” error

最后都变了- 提交于 2020-01-02 04:12:08
问题 I'm testing a UIWebview with a number of different document types - .xlsx, .jpg, etc. - and it opens most of them just fine. From time to time, I open a local file and this message appears right in the web view: Unable to Read Document An error occurred while reading the document I'm not concerned with "why" this error occurs - it happens, for instance, when I feed the UIWebView a garbage file (intentionally). The problem is that I can't figure out how to detect "when" this happens. It doesn

New error in iOS 5: WebKit discarded an uncaught exception

…衆ロ難τιáo~ 提交于 2019-12-31 22:40:11
问题 I am trying to load a UIWebView with the Facebook OAuth authorization URL and I am using the following code. When my UIWebView loads with Facebook login page, I enter my credentials, then press the "Log in" button. When I hit the button I am getting the following error: WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener:delegate: Application tried to present modally an active controller . This same code works fine with iOS 4.3

UIWebViewDelegate: webViewDidFinishLoad not called during in-page navigation

梦想的初衷 提交于 2019-12-31 21:34:55
问题 I have an app where users can navigate a pile of locally stored HTML files. I have a UIWebView , configured up correctly with a UIWebViewDelegate . Usually, when the user follows a link, shouldStartLoadWithRequest is called, followed by webViewDidFinishLoad a bit later. But, if the link is pointing to an anchor on the same page as the one which is currently displayed, only shouldStartLoadWithRequest is called. webViewDidFinishLoad does not fire. In a sense, I see that this might be expected