uiwebview

is it possible to free memory of UIWebView?

混江龙づ霸主 提交于 2019-11-30 16:26:32
i'm trying to release UIWebView object but it not free memory. is it have any reason? Maybe clearing the cache might help? See NSURLCache class. Just because you've released it doesn't mean that it can be released - maybe it's being used by something else? What is it's retain count after you have freed it? [myWebView release]; NSLog(@"%i", [myWebView retainCount]); If this number is not 0, someone else is retaining it as well and it can't be freed until they release it too (or it's set to be autoreleased so it will vanish at some point in the future). Another possibility is that the memory

UIWebView content not scaling between different iPhone sizes

匆匆过客 提交于 2019-11-30 16:10:56
So I am working on an iOS app that uses the UIWebView to serve HTML content. Why UIWebView and not WKWebView? well I want this app to work on iOS7 and above. I have just updated my Xcode to Xcode 6.1 and I cannot get my webView to scale to fit the available screen space when changing from the 4 inch screen size to 4.7 and above. What I am after is to have my app look consistent on all iPhone screen sizes of 4 inch and above as all my HTML5 code that is displayed on the web view is. In my Attributes inspector I have set the size to iPhone 4-inch and you can see what the app looks like in

UIWebView content not scaling between different iPhone sizes

谁说胖子不能爱 提交于 2019-11-30 16:08:50
问题 So I am working on an iOS app that uses the UIWebView to serve HTML content. Why UIWebView and not WKWebView? well I want this app to work on iOS7 and above. I have just updated my Xcode to Xcode 6.1 and I cannot get my webView to scale to fit the available screen space when changing from the 4 inch screen size to 4.7 and above. What I am after is to have my app look consistent on all iPhone screen sizes of 4 inch and above as all my HTML5 code that is displayed on the web view is. In my

Why can't I close or dismiss a Javascript alert in UIWebView?

Deadly 提交于 2019-11-30 16:08:20
问题 Situation: I invoke a Javascript alert through the UIWebView method stringByEvaluatingJavaScriptFromString: like this... [myWebView stringByEvaluatingJavaScriptFromString:@"alert('FOOBAR');"]; Problem: iOS displays an alert saying "FOOBAR" as expected, but tapping on the "Close" button does not dismiss the alert. Why can't I close the Javascript alert? How do I get it to close? 回答1: This question gave me the most insight to the problem... Deadlock with GCD and webView The gist is that the

UIWebView does not open ms word (doc) and ms excel (xls) files

元气小坏坏 提交于 2019-11-30 16:06:37
问题 I'm developing an application for iPad using XCode 3.2.5 iOS SDK 4.2. This application requires to open PDF, DOC and XLS files and preview them to the user. I'm trying to open them with the UIWebView control. Only PDF files are being opened correctly. When opening DOC or XLS I got a black empty view. This is happening in Simulator and Device. What am I doing wrong? Here is the code: -(void)prepareToShow:(NSString*)filePath fileType:(NSString*)fileType request:(NSURLRequest*)request{ UIWebView

iOS custom font path for UIWebViews

邮差的信 提交于 2019-11-30 15:57:28
问题 I have a UIWebView and I have a custom font I want to load into an editable html document that I will be displaying through the UIWebView. In my SupportingFiles (resources) folder I have "Nosifer-Regular.ttf"... To use the custom font in my HTML I need the path (URL) to the font tile... I tried doing this, but it didn't seem to work... any ideas? bundle = [NSBundle mainBundle]; pathFont = [bundle bundlePath]; fontURL = [NSBundle pathForResource:@"Nosifer-Regular" ofType:@"ttf" inDirectory

Prevent UIWebView for Repositioning for input field

纵然是瞬间 提交于 2019-11-30 15:54:41
问题 I have an iPad application in which I am displaying an input form as a UIWebView in a UIPopoverController. My popover controller is sized such that it does not have to be resized when the keyboard appears. When I tap in an input field in the UIWebView, the web view is pushed further up when the keyboard appears. It is pushed up to the point that the text field is at the top of the frame. (This is the standard behavior you see when using forms in mobile safari). The webview does not scroll at

open link from UIWebView into Safari (iphone)

萝らか妹 提交于 2019-11-30 15:54:34
问题 ok rather than try to explain my problem in text, watch this little video i recorded http://www.youtube.com/watch?v=fwb55jnZI6w and here is the code for the detail view controller (the page where the webview is) detailViewController.h #import <UIKit/UIKit.h> #import "MWFeedItem.h" @interface DetailViewController : UIViewController <UIWebViewDelegate> { MWFeedItem *item; NSString *summaryString; IBOutlet UILabel *titleLabel; IBOutlet UIWebView *contentLabel; //IBOutlet UILabel *dateLabel;

How to stop UIWebView loading immediately

故事扮演 提交于 2019-11-30 15:37:09
As ios documentation says, [webView stopLoading] method should be used in order to stop webview load task. As far as I see, this methods runs asynchronously, and does NOT stop currently processing load request immediately. However, I need a method which will force webview to immediately stop ongoing task, because loading part blocks the main thread, which could result in flicks on animations. So, is there a way to succeed this? This worked for me. if (webText && webText.loading){ [webText stopLoading]; } webText.delegate=nil; NSURL *url = [NSURL URLWithString:@""]; NSURLRequest *requestObj =

Autofill Username and Password UIWebView Swift

Deadly 提交于 2019-11-30 15:30:45
I've found many ways to autofill a username and password in objective-c, but I can't figure out how to make it work with Swift. What would be the Swift equivalent of this code and would this work for what I am trying to accomplish? Thanks - (void)webViewDidFinishLoad:(UIWebView *)webView { // Auto fill the username and password text fields, assuming the HTML has // <input type="text" name="username"> and // <input type="text" name="password"> NSString *savedUsername = [[NSUserDefaults standardUserDefaults] objectForKey:@"USERNAME"]; NSString *savedPassword = [[NSUserDefaults