uiwebview

uiwebview is not loading index.html the second time

I have an app that I load in a uiwebview, it first load a splashscreen and then the index.html file(the menu), fine, just as it should! But if I navigate to a different page eg page2.html and then close the app, and then start it again, then it is not loading the splashscreen and it does not load the index.html file, instead it loads...

Strange string size detection in iPhone

I have used a UIWebView to simply show a string, with font size 14px (declared in style) the string occupies approximately 1/4 - 1/3 of the iphone screen (in height) with restriction of width of 190 then I use NSString sizeWithFont: constrainedToSize: to detect how large is exactly this string. UIFont *font = [UIFont fontWithName:@"A...

How to modify JavaScript in a UIWebView programmatically?

Hi guys, I need to modify dinamically a Javascript inside my UIWebView. I load a file html locally, inside the Documents folder of my app. I need to create a var attributes like this: var attributes = { "feedURL": "http://www.obliviux.com/?feed=rss2", //insert NSString *RSS here "maxAgeToShow": "-1", //insert NSString *maxAge ...

differences between uiwebview and mobile safari

Have looked far and wide for info and have found no definitive list. Please add your observations. I'm sure it will come in handy to all. ...

How to get CDATA content into UIWebView in iPhone SDK?

Hi Guys, I am not understanding how to get the content of CDATA, I NSString* htmlString = [self getnerateFormattedString:details]; [webView loadHTMLString:htmlString baseURL:[NSURL URLWithString:@"http://www.myWebsite.com"]]; -(NSString*) getnerateFormattedString:(TrackDetails*) details { NSString* htmlString = @""; htmlStri...

how to use windowScriptObject on the iPhone?

Greetings! I was wondering how I could use javascript code on an iPhone application I was developing. this tutorial illustrated how to use windowScriptObjects for Cocoa application. However, I have been unable to locate something similar for UIWebViews. does this functionality actually exist in Cocoa touch? and if yes, could anyone poi...

JavaScript Broken in UIWebView's "Start Load" Callback

I'm trying to execute some JS before the page's onLoad event fires. But I'm having trouble successfully calling stringByEvaluatingJavaScriptFromString in the webViewDidStartLoad delegate method. To reproduce the issue, you can use the following code. Delegate implementation: -(void)webViewDidStartLoad:(UIWebView *)webView { [webV...

How to set background color for UIWebView in iPhone sdk

I have added the back ground color as an image to uiwebview but it is coming to the back side of web view not to the web view. The web view is always in white colored view, I can't change it. myView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; myView.autoresizingMask=YES; webView = [[UIWebView alloc] init]...

How to set content offset and content size in a UIWebView

I have had to change a UIScrollView into a UIWebView due to formatting reasons. There is a problem though that I need to be able to get the content offset back to 0, 0 (as I am using reusable UIWebViews and changing content) and get the content size so I can place a button at the bottom; but UIWebView does not seem to have this. ...

How can I prepopulate "Add Event" fields when user clicks date in iPhone UIWebView?

Since iOS3, the UIWebview component has had the ability to automatically detect and highlight dates within a UIWebView. Pressing the date brings up an actionsheet with an option to "Create Event" in the local calendar app. Unfortunately, the modal dialog that appears next contains ONLY the date, and no other information about the event. ...

UIMapView does not show content at first time.

I have a ViewController has a UIMapView as IBOutlet and the ViewController will be pushed into a navigationViewController. I use loadHtmlString:baseURL: method to set the content of the UIMapView, which works fine. But the content does not show at the first time when I pushed the ViewController to the NavigationViewController [richC...

return title of web page i'm visiting in a UIWebView

Hi, I created programmatically a view that contains a navigation bar like Safari, a web view and a toolbar... In the navigation bar I put a label and two text field, one for type URL and one for type search. But how can I use the label to show the web view page title? I tried this code but don't work! :( nomeSito.text = [webView strin...

iUI: Back button doesn't work in UIWebView

I have a mixed web/native app, and I use a (you guessed it) UIWebView to display the html portion of the app. Do to the nature of the app, I am using the view without any toolbar, including forward/back buttons. The html is designed using iUI. All of the "pages" are contained in the same document using ids to designate page content. Whe...

What's the best approach for parsing XML/'screen scraping' in iOS? UIWebview or NSXMLParser?

I am creating an iOS app that needs to get some data from a web page. My first though was to use NSXMLParser initWithContentsOfURL: and parse the HTML with the NSXMLParser delegate. However this approach seems like it could quickly become painful (if, for example, the HTML changed I would have to rewrite the parsing code which could be a...

Hide text selection handles after action in UIWebView

I have several custom UIMenuItems that do things with a selection in a UIWebView. After the action has been run on that selection I want to hide the selection handles just as copy: does. I have tried using window.getSelection().removeAllRanges(); and that works in that window.getSelection() no longer returns anything but the text selec...

Failed to create 5th http connection in iOS4

Hi all, In OS3.1.3, I can create 6 UIWebView in a single view to watch 6 MJPEG stream simultaneously. For the same application, it can run in iOS4 without any code modification. But it can only show 4 liveview feed at the same time. And I cannot send any request afterward. Is this a limitation for iOS4 for multitasking? Or I use some...

UIWebView iPhone OS 4.0 can't view YouTube video

Hi, I used to have a UIWebView that links to our web page. This page contains a list of YouTube videos and when each video is played when a user selects on it. This app works well in iPhone OS 3.0, but it doesn't work on iPhone OS 4.0 anymore. I tried loading my web page on iPhone Safari, it doesn't work either. I tried this URL htt...

UIWebView with files in memory

Writing HTML and especially images onto the iDevice's disk just to display them in a UIWebView is time-consuming and Apple actively discourages this because it shortens the flash memory's lifetime. I think it's possible to include image data right into the HTML, I know it's possible with CSS. Is there some way I can make a UIWebView ins...

Accessing UIWebView local storage data from native iPhone app

Hi - I'm writing a native iPhone app that contains a UIWebView component. This component accesses an internet webapp and the webapp stores data offline using HTML5 local storage. Is it possible to access this local storage data from the native app ? ...

Prevent caching of .css files in UIWebView loaded from disk.

In the iPad project I'm working on I've got a UIWebView inside of the app which displays a .html file which links to a .css file, i.e. <link rel="stylesheet" href="style.css" type="text/css"> These files are stored locally on the iPad but are fetched from a remote server. I've noticed that UIWebView caches the .css file more or less ...