I was having the same problem and switched to the new WKWebView and it immediately solved all of the memory leak issues I was seeing. WKWebView shares many of the same call names from UIWebView so all I had to do on my project is switch over all my `UIWebView'...
I fixed it. override func viewWillLayoutSubviews() { super.viewWillLayoutSubviews(); playerWebView.scrollView.contentInset = UIEdgeInsetsZero; } Adding to the edit i made to the question, i forgot swift changes set and get methods for accessor variables as in C#. ...
ios,objective-c,uiwebview,orientation
Put this in your AppDelegate: - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { id presentedViewController = [window.rootViewController presentedViewController]; NSString *className = presentedViewController ? NSStringFromClass([presentedViewController class]) : nil; if (window && [className isEqualToString:@"AVFullScreenViewController"]) { return UIInterfaceOrientationMaskAll; } else { return UIInterfaceOrientationMaskPortrait; } } Note: I have not tested this with...
I've done this in the past using UIPrintPageRenderer. It's a more versetile way of creating a PDF from a UIWebView, and it's been working well for me so far. I've tested this solution with Xcode 6 and iOS 8.2. Also, tried printing the resulting PDF and everything printed out fine....
ios,iphone,uiwebview,uiwebviewdelegate
The main reason is because, when you invoke the first time URL request, the server on the receiving end tries to display the information as per the requested device browser, ( like mobile, desktop). This is where you see a bit of delay. The server take some time to resolve...
ios,objective-c,iphone,uiwebview,grand-central-dispatch
Ehm.. GCD and UIWebView's -loadRequest: doesn't work as you think. All the code above is pretty equal to: dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ dispatch_async(dispatch_get_main_queue(), ^{ UIViewController *firstContrl = [self.viewControllers objectAtIndex:0]; firstContrl.tabBarItem.tag = (int)[[self viewControllers] indexOfObject:firstContrl]; [firstContrl view]; UIViewController *secContrl = [self.viewControllers objectAtIndex:1]; secContrl.tabBarItem.tag = (int)[[self viewControllers]...
ios,objective-c,performance,uiwebview,nsarray
I think using a custom cell with a Web View inside it will be the better. Although whole concept of Web View inside a table view is weird. Inside cellForRowAtIndexPath you would need to do something like: [cell.webView loadHTMLString:HTMLContent baseURL:nil]; The main advantage of Table View is that the number...
ios,xcode,scroll,uiwebview,swipe
This is how I implemented swipe gesture in UIWebView. Add <UIGestureRecognizerDelegate> protocol to ViewController.h In ViewDidLoad Method add the following code: UISwipeGestureRecognizer * swipeGestureDown = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swipeDown)]; swipeGestureDown.numberOfTouchesRequired = 1; swipeGestureDown.direction = UISwipeGestureRecognizerDirectionDown; swipeGestureDown.delegate = self; [self.webView addGestureRecognizer:swipeGestureDown]; Add Delegate method in ViewController.m :...
css,scroll,uiwebview,mobile-safari,hybrid-mobile-app
You mentioned you aren't using any libraries to do JS scrolling, but it looks like one of the libraries you're including (Polymer I believe) is taking over scrolling. To confirm this, use the Safari Web Inspector and disable javascript - you'll see that your sample page will no longer scroll...
javascript,ios,objective-c,swift,uiwebview
This solve my problem, var value = IBwebView.stringByEvaluatingJavaScriptFromString("get_JSON()") var err:NSError? var obj:AnyObject? = NSJSONSerialization.JSONObjectWithData(value!.dataUsingEncoding(NSUTF8StringEncoding)!, options:nil, error:&err) if let items = obj as? NSDictionary { var data1:String = items.objectForKey("data1") as? String var data2:String = items.objectForKey("data2") as? String var data3:String = items.objectForKey("data3") as? String } ...
Using jQuery to edit all of your images: $(function() { $("img").each(function(){ var filepath = $(this).attr("file"); if (filepath) this.src=filepath; }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <img src="wrongsrc" file="http://www.hi-pda.com/forum/uc_server/data/avatar/000/52/56/39_avatar_middle.jpg"></img> <img src="wrongsrc" file="http://www.hi-pda.com/forum/uc_server/data/avatar/000/52/56/39_avatar_middle.jpg"></img> <img...
I made it work. <script type='text/javascript'> document.addEventListener('touchend', function(e) {window.location='js-settarget:runTypeMethod';}, false); that would communicate with objective-c function on magnifying glass up....
ios,objective-c,iphone,uiwebview
set your web view delegate and frame. yourwebview.frame=[[UIScreen mainScreen] bounds]; yourwebview.delegate = self; end then use this delegate method to set height. - (void)webViewDidFinishLoad:(UIWebView *)aWebView { CGSize contentSize = aWebView.scrollView.contentSize; NSLog(@"webView contentSize: %@", NSStringFromCGSize(contentSize)); yourwebview.contentsize = contentSize; } ...
1: When you have set the NSUserDefaults for the key "host", have you also called synchronize on NSUserDefaults? 2: Please debug the variable NSString *host, is the right string in it? 3: Instead of NSString *fullURL = [NSString stringWithFormat:@"%@ %@", host, complement]; try this host = [host stringByAppendingString:complement]; 3.1: Is...
Hiding a view does not change its size or constraints, so the result you get is expected. You should probably have a height constraint on your table view, and make an IBOutlet to it. When there is no content in the table, modify the constant property of the constraint to...
objective-c,uiwebview,xcode6.1,ios8.1
Since you are using a storyboard you must use a Segue to present your ViewController. Delete your button action implementation and Control+Drag from your button onto your Help view controller. Link it to the Show segue.
Use its scroll view's content size which will be available after the web view responds to webViewDidFinishLoad on its UIWebViewDelegate like this: func webViewDidFinishLoad(webView: UIWebView!) { CGFloat totalHeight = webview.scrollView.contentSize.height } ...
Just display UIWebView on the IBAction? You're going to want something like this: @IBAction func newAction(sender: UIBarButtonItem) { // set up webview let webView = UIWebView(frame: self.view.frame) // or pass in a CGRect frame of your choice // add webView to current view self.view.addSubview(webView) self.view.bringSubviewToFront(webView) // load the Google Maps...
javascript,ios,objective-c,uiwebview
in case anyone else was wondering about that, the solution was a simple escape character. Thanks everyone. editedSearchString = [editedSearchString stringByReplacingOccurrencesOfString:@"á" withString:@"\\á"]; ...
javascript,html,ios,objective-c,uiwebview
I have solved by this : NSMutableArray *array = [[NSMutableArray alloc]initWithObjects:@"'Sudhaadagdudgdada'",@"'qwertyuiopo'",@"'asdfghjkl'", nil]; NSString *html = [NSString stringWithFormat:@"<div id='check'></div><script> var j; var jsArray = new Array %@; str=''; for(j = 0; j< 3; j++){ str += '<input type=\"checkbox\" name=\"one_'+j+'\" value = \"'+jsArray[j]+'\" onclick=\"alert(this.value);\" />'+jsArray[j]+'<br/><br/>'; }...
ios,swift,cocoa-touch,uiwebview,local-storage
I have now found out that the code in the question does in fact work, all the time on the phone, sometimes in the Xcode iOS simulator. I'm pretty sure it has something to do with the fact that creates new app directories every time you rebuild, but the localStorage...
I think if your html file or string have the url for the image then it will load it automatically you won't have to worry about it. look at your html file and make sure that you get your image url properly in html string.
This category adds methods to the UIKit framework’s UIWebView class. The methods in this category provide increased control over the request cycle, including progress monitoring and success / failure handling....
javascript,ios,html5,uiwebview
I don't think this can be done using public api. But you can do that using JavaScript like here: How to simulate a mouse click using JavaScript?: function simulate(element, eventName) { var options = extend(defaultOptions, arguments[2] || {}); var oEvent, eventType = null; for (var name in eventMatchers) { if...
ios,objective-c,xcode,uiwebview
[self.webView reload] - will reload the current page. This is probably happening before the loadRequest has finished. Try removing this line. Also, @joern's comment is correct; the 'event' is the user making a pan gesture. Lose the timer....
Did you mean to present the controller as modal? Perhaps it should be pushed on as follows?: - (IBAction)visiteSite:(id)sender { WebViewController *hospitalSite = [self.storyboard instantiateViewControllerWithIdentifier:@"hospitalSite"]; hospitalSite.hospitalWebURL = self.url; [[self navigationController] pushViewController:hospitalSite animated:YES]; } Also you might want to do your frame related code in viewWillAppear or viewDidAppear rather than viewDidLoad,...
Why not just use a UIWebViewController ,and tell the Cell to push a new WebViewController in a tap action.
There isn't a method that allows this directly via the SDK like there is on Mac however you may wish to take a look at BNHtmlPdfKit which allows you to save the contents of URLs, web views and also html strings as PDFs. For example, as follows: self.htmlPdfKit = [BNHtmlPdfKit...
Place the base64 encoded image data in a NSString removing the first part of that string and decode it using NSData: NSString *base64Str = [myString substringFromIndex:22]; NSData *data = [[NSData alloc]initWithBase64EncodedString:base64Str options:NSDataBase64DecodingIgnoreUnknownCharacters]; UIImage* myImg=[UIImage imageWithData:data]; (Works with IOS 7.0 and later)...
pdf,ios8,uiwebview,nsdocumentdirectory,writetofile
Okay, after mucking about I found that since the documents directory changes path every time I run the app, I had to: Write the file to the documents folder with the complete path to the file: NSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask ,YES ); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString...
ios,objective-c,swift,uiwebview
I assume that it is related that programmatically launching keyboard is disabled in Safari. By default, UIWebView doesn't allow either programmatically launching the keyboard. However, you can enable this functionality from the Swift side when you create the UIWebView. Just set keyboardDisplayRequiresUserAction to false. See Apple's documentation for more information...
ios,pdf,uiwebview,qlpreviewcontroller
The short answer to your question is: yes. The longer one is, well... a bit longer :) PDF/A, or PDF for Archival is an ISO standard that is based on the ISO standard for PDF itself (ISO 32.000). As a consequence, any software that supports "PDF" must also necessarily support...
ios,objective-c,iphone,uiwebview
Use UIWebViewDelegate's shouldStartLoadWithRequest method to check the URL your web view is trying to load. If URL is not one of the pages you want to allow access to, return false.
I imagine you can get this effect by changing the user agent. That should work with most web sites, unless they are really serious about trying to detect mobile devices (by checking window size, etc)....
Did you tried to set a delegate to the ScrollView instead of using the events? Something like this: public class ScrollViewDelegate : UIScrollViewDelegate { public override void Scrolled(UIScrollView scrollView) { Console.WriteLine("Scrolled"); } } ContractWebView.ScrollView.Delegate = new ScrollViewDelegate(); EDIT: Here is the complete code that I used for the test and...
ios,objective-c,caching,uiwebview
You may used ASIWebPageRequest , example given here Or If reachability got connectivity NSCachedURLResponse* response = [[NSURLCache sharedURLCache] cachedResponseForRequest:[webView request]]; NSData* data = [response data]; Store data in locally and use it whenever you got reachability offline....
Maybe you use zoom mode at your iPhone6/6plus.
javascript,ios,swift,uiwebview
To fake a onclick event from javascript you need to do something like this.. var aTag = document.createElement('a'); aTag.setAttribute('href',"http://www.google.com"); aTag.innerHTML = "link text"; aTag.click() the above code will hit the UIWebViewNavigationType.LinkClicked window.open("http://www.w3schools.com"); the above code will trigger UIWebViewNavigationType.other...
swift,ios5,uiwebview,touch-event
If you want to call a function while tapping a view you can use UITapGestureRecognizer override func viewDidLoad() { super.viewDidLoad() let tapRecognizer = UITapGestureRecognizer(target: view, action: "handleSingleTap:") tapRecognizer.numberOfTapsRequired = 1 self.view.addGestureRecognizer(tapRecognizer) } func handleSingleTap(recognizer: UITapGestureRecognizer) { //Do something here } ...
ios,swift,uiwebview,keyboard,inputaccessoryview
import UIKit extension UIViewController { func addNewAccessoryView(oldAccessoryView:UIView) { var frame = oldAccessoryView.frame; var newAccessoryView = UIView(frame:frame) newAccessoryView.backgroundColor = UIColor.lightGrayColor() let fn = ".HelveticaNeueInterface-Bold" var doneButton = UIButton(frame:CGRectMake(frame.size.width-80,6,100,30)) doneButton.setTitle("Done", forState: UIControlState.Normal) doneButton.setTitleColor(UIColor.blueColor(), forState: UIControlState.Normal) doneButton.titleLabel!.font = UIFont(name: fn,...
javascript,ios,css,uiwebview,scale
My coworker found the answer! Answer: You can't scale an <iframe> from the outside DOM, you have to postMessage() into the <iframe> and use document.body.style.webkitTransform = "scale(1337)" Hope this helps somebody else in need! Credit ultimately goes to http://adexcite.com/iframe_scaling_test.html...
ios,swift,uiwebview,uiscrollview,xcode6
Looks like it was a constraint problem, because when I add to the webViewDidFinishLoad this line: webView.addConstraint(NSLayoutConstraint(item: webView, attribute: NSLayoutAttribute(rawValue: 8)!, relatedBy: NSLayoutRelation(rawValue: 0)!, toItem: nil, attribute: NSLayoutAttribute(rawValue: 0)!, multiplier: 1.0, constant: (webView.scrollView.contentSize.height + 600.0))) It fixed the problem....
ios,objective-c,ipad,uiwebview,screen-orientation
I realized on that before IOS 8 The values of Screen size returned did not change according to the orientation of the App but from IOS8 onwards it does. Basically wherever I was calling CGRectMake to Create the rectangle I was using the wrong values of Height and Width to...
i find a way to do this,but i think this is not a good way. step 1------use NSURLConnection in override func viewDidLoad(){} section request = NSURLRequest(URL:url) let urlConnection:NSURLConnection = NSURLConnection(request: request, delegate: self)! step 2------ use the NSURLConnection delegate to func connection(connection: NSURLConnection, didFailWithError error: NSError){ println("didFailWithError") } func connection(connection:...
NSString *htmLData = @" ";//Write your all Response Here NSString *strTemplateHTML = [NSString stringWithFormat:@"<html><head> <style TYPE=\"text/css\"> img{max-width:100%;height:auto !important;width:auto !important;};</style></head><body style=\"margin:10; padding:0;\">%@</body></html>",htmLData]; [self.webView loadHTMLString:strTemplateHTML baseURL:nil]; ...
ios,uiwebview,metadata,wkwebview,apple-touch-icon
In Firefox for iOS we use a User Script (Link to code on Github) to find the icon that then passes them back to the application which downloads them using native code (Link to code on Github).
javascript,ios,uiwebview,sencha-touch-2
You need to listen to the touchstart event on the component that has the problem and then prevent the touchstart event if the activeElement does not match the target. Example: if (Ext.os.is.iOS) { this.innerElement.on({ scope: this, touchstart: "onTouchStart" }); } onTouchStart: function (e) { if (document.activeElement != e.target) { e.preventDefault();...
ios,objective-c,cocoa-touch,uiwebview
You can not get title of a website before you receive data from the URL. So Set your webview delegate to self Then in - webViewDidFinishLoad: to get title ...
ios,swift,uiwebview,nstimer,dispatch-async
Ok guys, I created a Worker in my Javascript code, so I can handle it like new threads but not in iOS (which was impossible to do using UIWebView). The solution is here: iOS Javascript Workers High CPU after terminate()
ios,swift,uiwebview,uitextview,nsattributedstring
extension String { var html2AttStr:NSAttributedString { return NSAttributedString(data: dataUsingEncoding(NSUTF8StringEncoding)!, options:[NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType, NSCharacterEncodingDocumentAttribute: NSUTF8StringEncoding], documentAttributes: nil, error: nil)! } } let yourAttributedText = "<style type=\"text/css\">#red{color:#F00}#green{color:#0F0}#blue{color: #00F; font-weight: Bold; font-size: 32}</style><span id=\"red\" >Red,</span><span id=\"green\" > Green...
ios,objective-c,iphone,uitableview,uiwebview
I still don't know why this is happing but I solved it using the following approach: I moved [tableView beginUpdates] and [tableView endUpdates] instructions to webViewDidFinishLoad method. At this way, whenever webViewDidFinishLoad be executed, it will updated the cell size correctly. Although I don't think that is the best solution,...
html,ios,objective-c,uiwebview,wkwebview
You have to copy all your web files to the app's NSTemporaryDirectory and call your index.html from there. Works fine on iOS 8.3 for me.
swift,url,uiwebview,uitextfield
webView.request is optional, so you’re using optional chaining. You just need to do the same with the request’s URL, which is also optional: self.addressBar.text = self.webView.request?.URL?.absoluteString Note, there’s no need to force-unwrap this with the ! on the end. This is because self.addressBar.text is itself of type String?....
NSMutableCharacterSet *characterSet =[NSMutableCharacterSet characterSetWithCharactersInString:@" "]; NSArray *arrayOfComponents = [phone_number componentsSeparatedByCharactersInSet:characterSet]; phone_number = [arrayOfComponents componentsJoinedByString:@""]; NSString *phoneURLString = [NSString stringWithFormat:@"tel:%@", phone_number]; NSString *escapedUrlString = [phoneURLString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSURL *phoneURL = [NSURL URLWithString:escapedUrlString]; ...
ios,xcode,swift,uiwebview,exc-bad-access
So I just realized that, for some reason, my segue was running off the main thread. Dispatching to the main queue fixed the issue.
ios,cookies,uiwebview,save,httpcookie
I had such a problem. I tried many ways. I decided use dirty hack :D That's my way: When I was getting NSHTTPURLResponse for facebook (or else) i save request url to NSUserDefaults: - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse*)response; if ([[httpResponse URL].absoluteString isEqualToString:@"http://www.simple.com/"]) { [[NSUserDefaults standardUserDefaults]...
ios,objective-c,iphone,uiwebview
The parent view was missing the user interaction enabled flag.
You could call stringByEvaluatingJavaScriptFromString and pass the appropriate javascript to emulate the key press. For the javascript see e.g. this answer....
html,ios,uiwebview,uiscrollview
the content of the uiwebview changed and reloaded.. one of solutions that i see is to check the previous offset of the uiwebview and store it..when the new html string is loaded scroll your web view to the same offset. if you can get the difference between the two html...
ios,objective-c,ipad,uiwebview
The main thing you should know is that you can't have multiple files in your bundle with the same name even if you put them in different directories cause when your code is compiled and converted to an ipa, all your bundle resources will be in the same folder. What...
I'm not sure how complicated your use of the UIWebView is but, the quickest implementation I can think of (aside from the evaluateJS route you've already done): Create a property to decide if a request has been hijacked yet (by you). var hijacked = false provide the UIWebViewDelegate protocol method....
I would suggest to use request.URL.host instead of retrieving it with auxiliary function and check if request.URL.scheme isEqualToString "my link" to be sure it's not some normal request. By the way, you probably don't want any requests with your custom scheme to be really performed, so return false to avoid...
javascript,ios,scroll,uiwebview
I'm surprised that the scroll event isn't firing. MDN has a list of events that can be bound to that might be of help to you. A quick thought that jumps out to me is that you could bind to the mouseup and input/change events on the select and in...
// show HTML content in webview there is two different types, as follow // 1. Using URL // for show web view with online url [_webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://jlhs.schoolloop.com/mobile/login"]]]; // 2. Using string // for show web view with help of string, local page NSString * htmlPage = @"<html><head><meta...
// i used that code For Next and Previous Functionality And it works fine // function uiWebview_HighlightAllOccurencesOfNextStringForElement(element,keyword) { if (element) { if (element.nodeType == 3) { // Text node while (true) { //if (counter < 1) { var value = element.nodeValue; // Search for keyword in text node var idx...
php,cookies,uiwebview,mobile-safari
Is the domain AND the protocol http / https the same? Cookies for http://example.com and https://example.com can be different. Also be wary with subdomains, maybe sub.example.com cookies can be not visible at example.com. You should check (I think you did, but if not, then do), if you have cookies enabled...
You can't easily get to it but there is a good trick that is well documented here: How to detect and handle HTTP error codes in UIWebView?...
shouldStartLoadWithRequest() won't get called if you haven't set the web view's delegate. In order to use UIWebView its typically set as an outlet property of a view controller, so you should have something like this: IBOutlet UIWebView* webView; The webView has a delegate property which needs setting to your view...
Your code is calling imageClicked at the point you're trying to just set it up as a handler. It's actually easier than you think it is: var imgs = document.getElementsByTagName("img"); for (var i = 0; i < imgs.length; i++) { imgs[i].onclick = imageClicked; // <=== Not *calling*, just referring to...
javascript,html,ios,objective-c,uiwebview
and an objective c solution: @interface ViewController () <UIWebViewDelegate> @property (weak, nonatomic) IBOutlet UIWebView *webView; @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://yourwebsite.com"]]]; } - (void)webViewDidFinishLoad:(UIWebView *)webView { NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; if ([userDefaults objectForKey:@"contentOffset"]) { webView.scrollView.contentOffset =...
ios,iphone,uiwebview,uiscrollview,uikit
We already solved it in the comments, so let's just put this answer for completeness' sake. If you're using Auto Layout, make sure to change the size of the WebView by setting constraints such as a height constraint and changing its constant to make the layout change. If you want...
ios,objective-c,iphone,twitter-bootstrap,uiwebview
To me it looks like the UIWebView is not set up correctly in the Storyboard or Interface Builder. Do you use Auto Layout? If so, are the constraints set correctly? A simple way to make sure the UIWebView is displayed full screen would be to add 4 constraints that align...
ios,xcode,uiwebview,uisplitviewcontroller
Have you tried conforming to the UIWebViewDelegate protocol? UIWebViewDelegate has these callbacks that will help you debug: webView:shouldStartLoadWithRequest:navigationType: webViewDidStartLoad: webViewDidFinishLoad: webView:didFailLoadWithError: All you need to do is find the identifier for the segue and pass the URL string to the DetailViewController when trying to segue into that controller and actually...
javascript,ios,swift,highcharts,uiwebview
UIWebView has a method called stringByEvaluatingJavaScriptFromString that you can use to run a script. I think that you can also use it to just pass and initialize any variable that you like.
ios,objective-c,uiwebview,ios-web-app
Put this code in viewDidLoad [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadWebView:) name:UIApplicationWillEnterForegroundNotification object:nil]; and this code in viewDidUnload [[NSNotificationCenter defaultCenter] removeObserver:self]; ...
ios,objective-c,uitableview,uiwebview
Skyler's answer's heading in the right direction, but it's missing a few critical pieces... Yes, you need to pass the web url string in prepareForSegue: like he's suggesting, i.e. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if([segue.identifier isEqualToString:@"recipeDetail"]) { NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; RecipeTableViewCell *cell = (RecipeTableViewCell*)[self.tableView cellForRowAtIndexPath:indexPath]; RecipeDetailViewController *recipeDetail =...
ios,objective-c,iphone,uiwebview,uikeyboard
Please use this category class it will help you. @interface UIWebView (GUIFixes) /** * @brief The custom input accessory view. */ @property (nonatomic, strong, readwrite) UIView* customInputAccessoryView; /** * @brief Wether the UIWebView will use the fixes provided by this category or not. */ @property (nonatomic, assign, readwrite) BOOL usesGUIFixes;...
javascript,ios,objective-c,uiwebview
Ok, so I figured out a good way to do this. In your javascript call add add this line to the end of your script : window.location = 'js-ObjC:jsCompleted'; Then use the UIWebView's shouldStartLoadWithRequest: method in order to capture and test for this new window location. I then called a...
You shouldn't pass directly your arrays in the stringWithFormat, you should first convert them into json objects and then pass those json objects (as string representation) to the stringWithFormat NSData *data1 = [NSJSONSerialization dataWithJSONObject:y1Arr options:0 error:NULL]; NSString *y1ArrStr = [[NSString alloc] initWithData:data1 encoding:NSUTF8StringEncoding]; NSData *data2 = [NSJSONSerialization dataWithJSONObject:y2Arr options:0 error:NULL];...
uiwebview,nsurlrequest,wkwebview,nsurlprotocol
After going through a lot of documentation, I realized/learnt that I'll not be able to track URLs if I use WKWebviews. I have to resort to UIWebView for the moment.
ios,objective-c,html5,video,uiwebview
After a discussion with Apple Support, the problem has been fixed. The problem has to do with the hardware H264 decoder. Basically, I was never removing the videos from the hardware decoder buffer by never releasing the video resources (which I thought javascript would do itself). So I was setting...
ios,objective-c,uiwebview,ios-simulator,mainbundle
That is correct. On iOS an App's bundle is read-only. Any attempts to save changes into your bundle will fail on an iOS device. On Mac OS the bundle is not read-only, but you should still treat it as read-only. Modifying your app's bundle is a bad idea. If the...
As most of the parameters reference the Request collection you could put the parameters in the querystring and thus make them part of the base url for UIWebView. So your URL request would look like file.asp?username=xxx&password=yyy&source=zzz&remember_me=on you would need to change line 7 in your sample file to be source...
ios,swift,uiwebview,mpmovieplayercontroller
Here's what's going on. When user interacts with UIWebView, it becomes first responder and inputAccessoryView provided by view controller disappears (no idea why behavior in this case is different from, say, UITextField). Subclassing UIWebView and overriding inputAccessoryView property does not work (never gets called). So I block interaction with UIWebView...
ios,uiwebview,xamarin,viewport,wkwebview
It turns out that the necessary launch images for the higher-res iPhones were present but not properly included in the iOS project, causing the app to load at the lower resolution of previous iPhones. Once [email protected] and [email protected] files were referenced, the app loaded as expected. Leave it to Apple...
ios,objective-c,iphone,uiwebview
Ok, after a few days debugging and looking at the project again, I've fixed it. And it has been entirely my fault from the start. Stupid me. :P It turns out that I've been making the layout from Compact-w Compact-h size class in the Story board. And when I looked...
PDF forms may bring along appearances or may rely on the viewer to create an appearance for the value of the field. Fairly complete PDF viewers (like Adobe Reader or Foxit) can get along with both variants well. Incomplete viewers, though, like many so called previewers, require an existing appearance...
ios,swift,uiwebview,nsurl,nsurlrequest
The problem is that you do not know what is nil. Add more logging, like this: let url = NSURL(string: "http://www.urartuuniversity.com/content_images/pdf-sample.pdf")! let request = NSURLRequest(URL: url) println(url) println(request) println(webView) webView.loadRequest(request) In this way, by putting your app through its paces and trying to reproduce the crash, you will discover, just...
ios,objective-c,iphone,uiwebview
Finally i found the problem. In my html i am using embed tag because of this it is crashing. <embed width ="600" height ="400" src="01.jpg" href="01.mp4" type="video/mp4" id="video-01"target ="myself" scale="1"/> Changed to <video controls="controls" autoplay="autoplay" loop width="600" height="400" poster="01.jpg" id="video-01" target="myself" scale="1"> <source src="01.mp4" type="video/mp4"> </video> it's working :) Thanks...
ios,caching,uiwebview,nsurlcache
I ended up creating a method similar to the NSURLConnectionDelegate method willCacheResponse, and replacing the Cache-Control:private header. willCacheResponse method func willCacheResponse(cachedResponse: NSCachedURLResponse) -> NSCachedURLResponse? { let response = cachedResponse.response let HTTPresponse: NSHTTPURLResponse = response as NSHTTPURLResponse let headers: NSDictionary = HTTPresponse.allHeaderFields var modifiedHeaders: NSMutableDictionary = headers.mutableCopy() as NSMutableDictionary modifiedHeaders["Cache-Control"] =...