Press button fill textfield inside UIWebview For iOS application - ios

i used normal code to link this url Front Page URL and on pressing button "Mulai" Its not working but the second button works and loads another page.
Here is the code i used :
_WebViewContent.delegate = self;
NSURL *url = [NSURL URLWithString:#"http://www.curhats.com/mobileapp/"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[_WebViewContent setScalesPageToFit:YES];
[self.WebViewContent loadRequest:request];
The Button Mulai This is mulai page
Please someone help me

Related

UIWebView does not load full content from an url

I have a UIWebView where i load a url. But it does not load full content. I have checked all possible forums for solution but couldn't find a breakthrough yet. Any help would be really appreciated? You can try out the below url yourself. Basically, the url is supposed to contain html5 content/player.
-(void)loadPlayerUrl
{
activityIndicatorView.hidden = NO;
NSURL* nsUrl = [NSURL URLWithString:#"http://watch.nimbletv.com/tv"]
NSURLRequest* request = [NSURLRequest requestWithURL:nsUrl cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:30];
[self.playerWebView loadRequest:request];
}
However, this works perfectly in safari or any other browser.
You should create ViewControllerWebPage
Then
- (void)viewDidLoad
{
[super viewDidLoad];
self.screenName = #"Info Ekran";
NSURL *mobileCreaURL = [NSURL URLWithString:#"http://mobilecrea.com/"];
NSURLRequest *myRequest = [NSURLRequest requestWithURL:mobileCreaURL];
[mobileCrea loadRequest:myRequest];
}
Also create new view, select your new custom class (ViewControllerWebPage) and than create UIWebView

UIWebView does not initially load certain URLs

Having such a bizarre issue with the UIWebView and I haven't been able to find a solution online. I have an iPad app that has a web view in it. Upon first install and run of the app, I try to load an education website. The web view just hangs and times out. I kill the app, I run it again, and it loads just fine. This one works fine which is also part of the education website. I'm pulling my hair out!
Some code:
-(void)viewDidAppear:(BOOL)animated
{
NSURL *websiteUrl = [NSURL URLWithString:#"http://my.tac.edu.au"];
NSURLRequest *urlRequest = [[NSURLRequest alloc]initWithURL: websiteUrl];
[self.webView loadRequest:urlRequest];
}
Works fine with www.tac.edu.au. I don't know what it is about that URL that makes it hang only when the app is first installed. You stop it, run it again (without uninstalling) and it comes up just fine. Any help would be appreciated.
:)
instead of view did appear , write the code in view will appear
-(void)viewWillAppear:(BOOL)animated
{
NSURL *websiteUrl = [NSURL URLWithString:#"http://my.tac.edu.au"];
NSURLRequest *urlRequest = [[NSURLRequest alloc]initWithURL: websiteUrl];
[self.webView loadRequest:urlRequest];
self.webview.delegate = self;
}
- (void)webViewDidStartLoad:(UIWebView *)webView{
//Start Activity Indicator
}
- (void)webViewDidFinishLoad:(UIWebView *)webView{
//End activity indicator
}

Present SWRevealViewController When WebView link is tapped

I have a MainViewController with webViewMain.
The following functions checks if a link is ready to send a user to a certain directory in my webview.
- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType {
NSURL *url = request.URL;
NSString *path = [url path];
if ([path isEqualToString:#"/mypath/"]){
NSLog(path);
return NO; }
return YES;
}
That code is all working fine. However, when the link is tapped I want to show my SWReveal Sidebar (sw_rear) and display the URL in that ViewController.
How can I do this?
I'm not understanding your scenario 100%, but with luck these steps will get you where you need to be.
Fetch the revealer and the rear view controller that holds your target webview:
SWRevealViewController *revealer = self.revealViewController; // 'self' here should be a view controller
UIViewController *rearVC = revealer.rearViewController;
UIWebView *webview = rearVC.webView;
Load up your URL:
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView loadRequest:request];

Loading a UIWebview when pressing a UIButton

I am developing a simple testing app for iPhone. I want to click a button to change the URL of webview, then load the new URL. Here is my code:
NSString *nurl = [NSString stringWithFormat: #"http://www.abc.com/abc.aspx?SN=%#&fdate=%#&tdate=%#", SNstr, fDate, tDate];
NSLog(#"################: %#", nurl);
NSURL *url = [NSURL URLWithString:nurl];
NSLog(#"################: %#", url);
NSURLRequest *req = [NSURLRequest requestWithURL:url];
[Logs loadRequest:req];
It is working well inside viewDidLoad.
I move it into a button:
-(IBAction)CheckLog:(id)sender
{
// codes here
}
When I press the button, it gives nurl's value correct, but url's value is null. So nothing is changed on the UIWebView Logs.
Why could this be, when the code runs correctly in viewDidLoad?
your button action will be like this...
-(IBAction)CheckLog:(id)sender
{
[[NSURLCache sharedURLCache] removeAllCachedResponses];
NSString *nurl = [NSString stringWithFormat: #"http://www.abc.com/abc.aspx?SN=%#&fdate=%#&tdate=%#", SNstr, fDate, tDate];
NSURL *url = [NSURL URLWithString: [nurl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] ];
// NSURL *theURL = [NSURL URLWithString:#"https://www.google.co.in/"]; // Your new URL
[self.myWebView loadRequest:[NSURLRequest requestWithURL:url]];
}
The first thing to check is that the method is definitely being called. Are your NSLog statements being printed? If not, check that you have connected the button to the IBAction correctly in Interface Builder.
I can't see anything in your code that is immediately jumping out to me as incorrect, so your best bet is to set a breakpoint at the start of the method and step through it line-by-line, checking the values of each variable as you go.

How to load a UIWebView when click a button in another view in ios

I want to create an ios application which incuding a UIWebview. I saw so many tutorials that saying how to load webview when start the application. But what I want is when user click on a link in one View,the web page should be loaded in seperate View. This is the code in my button click event.
`
-(IBAction)visitWeb:(id)sender{
web *wb=[[web alloc]initWithNibName:nil bundle:nil];
[self presentModalViewController:wb animated:YES];
[wb release];}
This is in web
`
- (void)viewDidLoad {
NSString *urlAddress = #"http://www.google.com";
//Create a URL object.
NSURL *url = [NSURL URLWithString:urlAddress];
//URL Requst Object
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
//Load the request in the UIWebView.
[webView loadRequest:requestObj];
[super viewDidLoad]; }
But it not display anything. Just display the empty UIWebView What is the reason for it.plz give me a solution with the code.
Thanks,

Resources