uiwebviewdelegate

UIWebView not go to didFailLoadWithError when webLink not found?

我们两清 提交于 2019-12-28 13:48:26
问题 I use UIWebView to load web from a webLink and UIWebViewDelegate to control error state: [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:webLink]]]; - (void)webViewDidStartLoad:(UIWebView *)webView{ NSLog(@"START LOAD"); } - (void)webViewDidFinishLoad:(UIWebView *)webView{ NSLog(@"FINISH LOAD"); } - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{ NSLog(@"ERROR : %@",error); } But when webLink not found, it NOT go to didFailLoadWithError , it go

webViewDidFinishLoad not calling when having javascript content in webpage

时光总嘲笑我的痴心妄想 提交于 2019-12-25 02:05:34
问题 I'm using UIWebView in a project. Sometimes it doesn't call the webViewDidFinishLoad method. Because the web page have some javascripts. The method - (BOOL) webView: (UIWebView *) webView shouldStartLoadWithRequest: (NSURLRequest *) request navigationType: (UIWebViewNavigationType) navigationType is getting call but webViewDidFinishLoad doesn't. I want to catch that method. Because I'm start an animation when the webview start loading. Then I want to stop this animation when it finished. It's

How to detect when UIWebView starts loading when Webview is inside a Collection View cell?

为君一笑 提交于 2019-12-24 08:42:21
问题 I am loading a collection view of cells containing UIWebView s. There's a time gap between when my UICollectionView 's activity indicator stops spinning and the UIWebView loads. I am trying to get a reference to when the loading starts (and eventually when it stops) in order to add another activity indicator UI. I'm not sure how to do it here though since my UIWebView is in my CollectionViewCell and not my CollectionView , in other words I can't use the delegate methods and set myself as my

ios - How to append javascript with HTML content?

混江龙づ霸主 提交于 2019-12-24 07:17:04
问题 I'm trying to get access token,I'm following this link to get that,but some condition fails,I think am not properly append the javascript with HTML content. - (void)connectionDidFinishLoading:(NSURLConnection *)connection { if(_data) { NSString* content = [[NSString alloc] initWithData:_data encoding:NSUTF8StringEncoding]; [_data release]; _data = nil; NSString *jsString = @"<script type='text/javascript'>\ window.external =\ {\ 'Notify': function(s) { document.location = 'acs://settoken

Properly force or allow Landscape mode for Youtube embedded video in iOS 8 without NSNotificationCenter

血红的双手。 提交于 2019-12-22 06:39:12
问题 I am having issues of capturing when the youtube player will enter in fullscreen or exit fullscreen in iOS 8 because these notifications were removed UIMoviePlayerControllerDidEnterFullscreenNotification and UIMoviePlayerControllerWillExitFullscreenNotification for this version OS version. Because my app project is set to be only in portrait mode the video won't rotate to landscape mode when is playing which is really not too user friendly when watching a video on your device. Usually the

shouldStartLoadWithRequest is never called

≡放荡痞女 提交于 2019-12-22 05:07:25
问题 I've researched and researched and still don't understand why shouldStartLoadWithRequest is never called. My page loads fine and some of the UIWebview delegate protocol methods are called. Please find relevant snippets from my code below: Synthesize my webview in my .m (defined in a header file): @implementation PortViewController @synthesize WebView = myWebView; I load my webview successfully: myURLString = [NSString stringWithFormat:@"https://%@", defaultWebsite]; myURL = [NSURL

How to log into web site using uiwebview with swift?

我们两清 提交于 2019-12-21 20:13:02
问题 I want to try to log into a web page using UIWebView in an ios applicaiton. However, I do not know how can I do this. I am showing web site with let url = NSURL(string: "http://m.falalem.com") let request = NSURLRequest(URL: url!) webView.loadRequest(request) I want to log into this page using my username and password parameter. Login Page -> http://m.falalem.com/Login After login page -> http://m.falalem.com/User-Info How can log into this page using uiwebview?? Please help! 回答1: Logging

Listen to all requests from UIWebView

北战南征 提交于 2019-12-21 17:44:57
问题 I can intercept the initial load request from a UIWebView with: (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType. How do I log all the requests from the page I'm loading? 回答1: Update: Another option is to use NSURLProtocol to hear requests the application makes, including all the ones from the web view. I will suggest a creative solution. This is not really what you want, but since that is not really

Progress bar (and network activity status) for UIWebView

余生颓废 提交于 2019-12-21 06:26:00
问题 After a long break I've started doing ios development again. With that in mind I downloaded the latest version of XCode (5.02) and set about coding an app with ios7 as the target. Everything was going fine until I added a "webView page" to my app. I was naively expecting UIWebView to work just like a page in Safari, but it doesn't. The most obvious thing missing is that there's absolutely no feedback to the user while the page is loading. i.e. the network activity indicator doesn't appear at

Progress bar (and network activity status) for UIWebView

走远了吗. 提交于 2019-12-21 06:25:30
问题 After a long break I've started doing ios development again. With that in mind I downloaded the latest version of XCode (5.02) and set about coding an app with ios7 as the target. Everything was going fine until I added a "webView page" to my app. I was naively expecting UIWebView to work just like a page in Safari, but it doesn't. The most obvious thing missing is that there's absolutely no feedback to the user while the page is loading. i.e. the network activity indicator doesn't appear at