Search Results

Search found 472 results on 19 pages for 'uiwebview'.

Page 8/19 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • iPhone app with UIWebView

    - by chaitanya
    Hi, I have a doubt in developing apps for iphone, Can I develop authentication page(with secure login id and pwd) through which I can load my webcontent. Does apple allow applications having login credentials or not? Can anyone please let me know this. Thanks in advance..

    Read the article

  • Load HTML NSString into a UIWebView

    - by ehenrik
    Im doing a project where I connect to a webpage using the NSURLConnection to be able to monitor the status codes that are returned (200 OK / 404 ERROR). I would like to send the user to the top url www.domain.com if I recieve 404 as status code and if i recieve as 200 status code I would like to load the page in to a webview. I have seen several implementations of this problem by creating a new request but I feel that it is unnecessary since you already received the html in the first request so i would just like to load that HTML in to the webView. So i try to use the [webView loadHTMLFromString: baseURL:] but it doesn't always work, I have noticed that when i print the NSString with html in the connectionDidFinnishLoading it sometimes is null and when I monitor these cases by printing the html in didReceiveData a random number of the last packets is NULL (differs between 2-10). It is always the same webpages that doesn't get loaded. If I load them to my webView using [webView loadRequest:myRequest] it always works. My implementation looks like this perhaps someone of you can see what Im doing wrong. I create my first request with a button click. -(IBAction)buttonClick:(id)sender { NSURL *url = [NSURL URLWithString:@"http://www.domain.com/page2/apa.html"]; NSURLRequest *theRequest = [NSURLRequest requestWithURL:url] NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self]; if( theConnection ) { webData = [[NSMutableData data] retain]; } else { } } Then I monitor the response code in the didReceiveResponse method by casting the request to a NSHTTPURLResponse to be able to access the status codes and then setting a Bool depending on the status code. -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { NSHTTPURLResponse *ne = (NSHTTPURLResponse *)response; if ([ne statusCode] == 200){ ok = TRUE; } [webData setLength: 0]; } I then check the bools value in connectionDidFinnishLoading. If I log the html NSString I get the source of the webpage so i know that it isn't an empty string. -(void)connectionDidFinishLoading:(NSURLConnection *)connection { NSString *html = [[NSString alloc] initWithBytes: [webData mutableBytes] length:[webData length] encoding:NSUTF8StringEncoding]; NSURL *url = [NSURL URLWithString:@"http://www.domain.com/"]; if (ok){ [webView loadHTMLString:html baseURL:url]; ok = FALSE; } else{ //Create a new request to www.domain.com } } webData is an instance variable and I load it in didReceiveData like this. -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { [webData appendData:data]; }

    Read the article

  • How can I tell when a UIWebView has finished drawing to a context?

    - by phopkins
    In my code I'm trying to show a UIWebView as a page is loading, and then, when it's done, capture an image from the web view to cache and display later (so I don't have to reload and render the web page). I have something along the lines of: CGContextRef context = CGBitmapContextCreate(…); [[webView layer] renderInContext:context]; CGImageRef imageRef = CGBitmapContextCreateImage(context); UIImage *image = [UIImage imageWithCGImage:imageRef]; The problem I'm running into is that, due to UIWebView's tiling, sometimes only half of the page is rendered to the context by the time I capture the image. Is there a way to detect or block on UIWebView's background rendering thread so that I can get the image only after all of the rendering has finished?

    Read the article

  • How to recognize touch events and control a script object inside UIWebView?

    - by Markus S.
    Situation: I have an UIView with an UIWebView in it. When the viewDidLoad the Javascript Object inside the UIWebView is called (Microsoft Seadragon AJAX JS). For your Understanding: Seadragon loads a specified megapixel image(JPEG) and in a Desktop Browser like Firefox i can Zoom into the image and I can drag the crop for example from the middle to the left. In the iPhone Simulator (for iPad) only the Zooming Function is working on one single tap but when i try to drag the crop (with left mouse button click and holding it) I'm dragging the whole UIWebView but not the crop of course! Is that feature which the simulator isn't able to handle or what's yout solutin guys? Special Thanks!! P.S.: It's a bit jiggling when the zooming function of Seadragon is called. Is that authentic to the real performance of the iPad or does the simulator not have the power as the iPad has?

    Read the article

  • Is it possible to populate HTML form field data in an iPhone UIWebView using external accessory fram

    - by Jon Smallberries
    I have an iPhone app where I'd like to load a remotely served HTML form into a UIWebView and then populate that form as data becomes available from an external accessory using the "External Accessory Framework." Right now the data is entered by hand. The proposed flow is: Fetch an HTML page containing a form and put it into a UIWebView When data becomes available from the external accessory, populate the form field(s) Submit the form Is it possible to do this by "injecting" data from the external accessory into the UIWebView when all required data has been retrieved from the external accessory? I cannot seem to find any good examples on how to use the external accessory framework to achieve this.

    Read the article

  • How do I make UIWebView show a pdf file from its own app?

    - by Aakburns
    I really need to make a UIWebView open up a specific PDF document that is in my project directory. I can't seem to find any tutorials on this. I found one, but the author was not specific about some of the code. I have to assume it's got to be quite a simple bit of code. Can someone help me code UIWebView to load a PDF? Thanks.

    Read the article

  • UIWebView leak? Can someone confirm?

    - by Shaggy Frog
    I was leak-testing my current project and I'm stumped. I've been browsing like crazy and tried everything except chicken sacrifice. I just created a tiny toy project app from scratch and I can duplicate the leak in there. So either UIWebView has a leak or I'm doing something really silly. Essentially, it boils down to a loadRequest: call to a UIWebView object, given an URLRequest built from an NSURL which references a file URL, for a file in the app bundle, which lives inside a folder that Xcode is including by reference. Phew. The leak is intermittent but still happens ~75% of the time (in about 20 tests it happened about 15 times). It only happens on the device -- this does not leak in the simulator. I am testing targeting both iPhone OS 3.1.2 and 3.1.3, on an original (1st Gen) iPod Touch that is using iPhone OS 3.1.3. To reproduce, just create a project from scratch. Add a UIWebView to the RootViewController's .xib, hook it up via IBOutlet. In the Finder, create a folder named "html" inside your project's folder. Inside that folder, create a file named "dummy.html" that has the word "Test" in it. (Does not need to be valid HTML.) Then add the html folder to your project in Xcode by choosing "Create Folder References for any added folders" Add the following to viewDidLoad NSString* resourcePath = [[NSBundle mainBundle] resourcePath]; NSString* filePath = [[resourcePath stringByAppendingPathComponent:@"html"] stringByAppendingPathComponent:@"dummy.html"]; NSURL* url = [[NSURL alloc] initFileURLWithPath:filePath]; NSURLRequest* request = [NSURLRequest requestWithURL:url]; // <-- this creates the leak! [browserView loadRequest:request]; [url release]; I've tried everything from setting delegate for the UIWebView and implementing UIWebViewDelegate, to not setting a delegate in IB, to not setting a delegate in IB and explicitly setting the web view's delegate property to nil, to using alloc/init instead of getting autoreleased NSURLRequests (and/or NSURLs)... I tried the answer to a similar question (setting the shared URL cache to empty) and that did not help. Can anyone help?

    Read the article

  • Activity Indicator not displaying based on whether the UIWebView is loading or not...

    - by Jack W-H
    Hi folks Sorry if this is an easy one. Basically, here is my code: MainViewController.h: // // MainViewController.h // Site // // Created by Jack Webb-Heller on 19/03/2010. // Copyright __MyCompanyName__ 2010. All rights reserved. // #import "FlipsideViewController.h" @interface MainViewController : UIViewController <UIWebViewDelegate, FlipsideViewControllerDelegate> { IBOutlet UIWebView *webView; IBOutlet UIActivityIndicatorView *spinner; } - (IBAction)showInfo; @property(nonatomic,retain) UIWebView *webView; @property(nonatomic,retain) UIActivityIndicatorView *spinner; @end MainViewController.m: // // MainViewController.m // Site // // Created by Jack Webb-Heller on 19/03/2010. // Copyright __MyCompanyName__ 2010. All rights reserved. // #import "MainViewController.h" #import "MainView.h" @implementation MainViewController @synthesize webView; @synthesize spinner; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { // Custom initialization } return self; } // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { NSURL *siteURL; NSString *siteURLString; siteURLString=[[NSString alloc] initWithString:@"http://www.site.com"]; siteURL=[[NSURL alloc] initWithString:siteURLString]; [webView loadRequest:[NSURLRequest requestWithURL:siteURL]]; [siteURL release]; [siteURLString release]; [super viewDidLoad]; } - (void)flipsideViewControllerDidFinish:(FlipsideViewController *)controller { [self dismissModalViewControllerAnimated:YES]; } - (void)webViewDidFinishLoad:(UIWebView *)webView { [spinner stopAnimating]; spinner.hidden=FALSE; NSLog(@"viewDidFinishLoad went through nicely"); } - (void)webViewDidStartLoad:(UIWebView *)webView { [spinner startAnimating]; spinner.hidden=FALSE; NSLog(@"viewDidStartLoad seems to be working"); } - (IBAction)showInfo { FlipsideViewController *controller = [[FlipsideViewController alloc] initWithNibName:@"FlipsideView" bundle:nil]; controller.delegate = self; controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentModalViewController:controller animated:YES]; [controller release]; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)dealloc { [spinner release]; [webView release]; [super dealloc]; } @end Unfortunately nothing is ever written to my log, and for some reason the Activity Indicator never seems to appear. What's going wrong here? Thanks folks Jack

    Read the article

  • Display "custom" view (various images, various text). Should I use UIWebView?

    - by aw
    First: No, none of the content should be loaded from the web. All content parts are shipped with the main bundle. I have n images and mass of text (including lists). Instead of building all view parts programmatically in objective-c if was thinking of using an UIWebView and build "only" the HTML dynamically. Does anything speaks against it? How does UIWebView work with local content? Links and resources welcome. Thanks

    Read the article

  • How do I find what text/HTML is on screen in a UIWebview?

    - by Grant M
    I would like to know what the first piece of text/html that is currently showing on screen, or more generally where in pixel location a particular tag or piece of text is in the UIWebview. I know that I can use window.pageYOffset to get the scroll position of the UIwebview, but how do I find out what text or HTML item is there?

    Read the article

  • Embed Youtube in UIWebView behind transparent img. Wmode transparent and z-index doesn't work

    - by Allisone
    I'm using this code: - (void)embedYouTube:(NSString *)urlString frame:(CGRect)frame { NSString *embedHTML = @"\ <html><head>\ <style type=\"text/css\">\ body {\ background-color: black;\ }\ #container{\ position: relative;\ z-index:1;\ }\ #video,#videoc{\ position:absolute;\ z-index: 1;\ border: none;\ }\ #tv{\ background: transparent url(tv.png) no-repeat;\ width: 320px;\ height: 205px;\ position: absolute;\ top: 0;\ z-index: 999;\ }\ </style>\ </head><body style=\"margin:0\">\ <div id=\"tv\"></div>\ <object id=\"videoc\" width=\"240\" height=\"160\">\ <param name=\"movie\" value=\"%@\"></param>\ <param name=\"wmode\" value=\"transparent\"></param>\ <embed wmode=\"transparent\" id=\"video\" src=\"%@\" type=\"application/x-shockwave-flash\" \ width=\"240\" height=\"160\"></embed>\ </object>\ </body></html>"; NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; NSString *html = [NSString stringWithFormat:embedHTML, urlString,urlString]; UIWebView *videoView = [[UIWebView alloc] initWithFrame:frame]; [videoView loadHTMLString:html baseURL:baseURL]; [self.view addSubview:videoView]; [videoView release]; } Its the first time that I use UIWebView and the first time that I use video in iPhone. The video plays, so that's working BUT: I want to have an old school tv (round corners) in foreground with switches and so on. The tv is an image with transparent pixels in the middle, so that a video lying behind the tv will shine through as if the video would be shown on the tv. But first of all the video has a border that I can't remove and second it's always in the foreground. In Safari and in Firefox and Mac it's working. So is it an iPhone thing, could it be that it simply won't work on iPhone ? Or do I have some css/html typos ?

    Read the article

  • Problem with TTWebController… alternative view controller template for UIWebView?

    - by prendio2
    I have a UIWebView with content populated from a Last.fm API call. This content contains links, many of which are handled by parsing info from the URL in: - (BOOL)webView:(UIWebView *)aWbView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType; …and passing that info on to appropraite view controllers. When I cannot handle a URL I would like to push a new view controller on the stack and load the webpage into a UIWebView there. The TTWebController in Three20 looks very promising since it has also implemented a navigation toolbar, loading indicators etc. Somewhat naively perhaps I thought I would be able to use this controller to display web content in my app, without implementing Three20 throughout the app. I followed the instructions on github to add Three20 to my project and added the following code to deal with URLs in shouldStartLoadWithRequest: TTWebController* browser = [[TTWebController alloc]init]; [browser openURL:@"http://three20.info"]; //initially test with this URL [self.navigationController pushViewController:navigator animated:YES]; This crashes my app however with the following notice: *** -[TTNavigator setParentViewController:]: unrecognized selector sent to instance 0x3d5db70 What else do I need to do to implement the TTWebController in my app? Or do you know of an alternative view controller template that I can use instead of the Three20 implementation?

    Read the article

  • iPhone: Leak with UIWebView loading Office documents. Any ideas how to avoid it?

    - by Thomas Tempelmann
    While there are already quite a few posts about leaks around UIWebView, mine is a bit more special, I believe, and thus deserves its own post here. I see a reproducible large leak every time I load a Office document such as a Word or Excel file. For instance, every time I display a 180KB .doc file, I get a 100KB leak. And that happens with both the simulator and an actual device, running OS 3.1.3. The leak is not visible with the Leaks instrument but only by looking at the malloc instances via the ObjectAlloc instrument. Here's a picture from the instruments trace: I've also made a demo project, UIWebView-Leak.zip, so you can verify this yourself. To see the leak, use the ObjectAlloc instrument, switch to the view where you see individual allocation objects, and sort by size so that you see the large ones in a group, just like in my picture above. Then view a Office document a few times and find the Malloc objects that keep staying "Live" even after the actual UIWebView has been freed. Is this a known bug? Or is there any way I can avoid these leaks? I.e, have you successfully shown Office documents on an iPhone withing getting such leaks? Note: I've reported this as a bug to Apple now, too (ID 7950594) I am still waiting for someone (including Apple) to confirm this as a true leak or show why it isn't (i.e. that I do something wrong or make wrong assumptions)

    Read the article

  • How to make same UIWebView take data from different local .html files?

    - by Mike Rychev
    I have an app, where there's one UIWebView and a UITableView. I don't want to create many .xib's, so I decided to make one .xib for all elements of the table. When user chooses a table element, the UIWebView appears and I want it to load data from different .html's depending on the name of the parent controller. I tried this: if (selectedTableElement==@"FirstElement") { [childController.message loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"_" ofType:@"html"]isDirectory:NO]]]; } And then myWebView=message; But it didn't work. Thanks in advance!

    Read the article

  • passing user from UITableView to UIWebView based on selection

    - by ct2k7
    Hello, I'm trying to pass the user on to the interface based on their cell selection in the UITableView, ie, if the user selects cell 1, they are taken to view model 2, containing UIWebView. UIWebView then displays local file, cell1.html. Currently, I've manage to get placeholder using: selectedCellText.text = selectedCell; to display the name of the cell selected. How do I get it to directly pass to the UIWebView, stick UIWebView in the interface and link it using: UIWebView *myWebView = [[UIWebView alloc] initWithFrame:frame]; NSBundle *mainBundle = [NSBundle mainBundle]; NSString *stringUrl = [mainBundle pathForResource:@"selectedCell" ofType:@"html"]; NSURL *baseUrl = [NSURL fileURLWithPath:stringUrl]; NSURLRequest *urlRequest = [NSURLRequest requestWithURL:baseUrl]; [myWebView loadRequest:urlRequest]; My other issue is that some of the cell names have spaces in them, and for simplicity, I'd like to ensure that there are no spaces (actually, will it even work with spaces in the name, I assume with %20 ? Thanks

    Read the article

  • Determining when stringByEvaluatingJavaScriptFromString has finished

    - by alku83
    I have a UIWebView which loads up an HTML page. This page has two buttons on it, say Exit and Submit. I don't want users to be able to click the Exit button, so once the page has finished loading (ie. webViewDidFinishLoad is called), I use stringByEvaluatingJavaScriptFromString to remove one of these buttons, by manipulating the HTML. I also disable user interaction on the UIWebView on webViewDidStartLoad, and enable it again on webViewDidFinishLoad. The problem I am finding is that stringByEvaluatingJavaScriptFromString takes a second or two to complete, and it seems to be done in it's own thread. So what is happening is that webViewDidFinishLoad is called, user interaction is enabled on the UIWebView, and if the user is quick, they can click the Exit button before stringByEvaluatingJavaScriptFromString has finished. As stringByEvaluatingJavaScriptFromString seems to be on it's own thread with no way to know when it's finished (it doesnt call webViewDidFinishLoad), the only way to completely prevent users from tapping the Exit button that I can see is to only enable user interaction on the UIWebView after some delay, which is unreliable (how can I really know how long to delay for?). Am I correct in that stringByEvaluatingJavaScriptFromString is done on it's on thread, and I have no way of being able to tell when it's finished? Any other suggestions for how to get around this problem? EDIT: In short, what I want to know is if it is possible to disable a UIWebView while stringByEvaluatingJavaScriptFromString is executing, and re-enable the UIWebView when the javascript is finished. EDIT 2: There's an article here which seems to imply you can somehow poll the JS engine to see when it's finished, but I can't find any other references saying the same thing: http://drnicwilliams.com/2008/11/10/to-webkit-or-not-to-webkit-within-your-iphone-app/ EDIT 3 Based on the answer from Brad Smith, it seems that I actually need to know when the UIWebView has finished loading itself after the javascript has executed. It's looking more and more like I just need to put a delay of sorts in there.

    Read the article

  • How can I prevent the scaling of a UIWebview's content after reorientation?

    - by frankhermes
    I'm building an iOS 5/6 app that has a UIWebView. It loads some HTML that I have embedded in my app. Now when I rotate my device, the WebView changes its size (as I want it to fill the entire width of the screen). And then it gets weird: some content gets scaled up and some content doesn't get scaled up. See this image with some example text in it: As you can see, the header (H6) stays the same, while the paragraph gets scaled up. Does anybody have an idea how to prevent this? I want the html to look the same in landscape as it does in portrait mode. I've tried setting the viewport scaling to 1: <meta name="viewport" content="initial-scale=1.0,max-scale=1.0"> but that doesn't help. The body's font-size style is set to 14px, but changing that to 14pt or a percentage also made no difference. Setting the width of the body to 100% also didn't help. Strangely, removing the line break (<br/>) that's in the text fixes it but I need line breaks to be in there so that's no solution. The only thing that does work is reloading the UIWebView's content after an orientation change, but that doesn't prevent it from looking wrong during rotation, and it resets any scrolling that the user may have done. Any ideas?

    Read the article

  • Is it possible to download a .zip file into iPhone when user clicks a link inside UIWebView?

    - by Horace Ho
    In a new app, I plan to let users download their own files and stored them inside iPhone. The process is typically: iPhone present a web page by UIWebView, in which there are several links to .zip files the user browser the page and click on one of the .zip file link iPhone downloads the file into the iPhone document folder, closes WebView, acknowledges the user when download is complete How can that be done? Thanks

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >