i am making an iPad application,
i want to load 2 webPage on single UIWebView one after another,
1st webpage should come when i load my application,and 2nd webpage should come on click of cell of tableView,
so,inside my didLoad method i am writing this (1st webpage),
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];
it works fine..
but on the same page on same webview on click of cell of tableView i want to load another page,(2nd webpage)
i written code for loading 2nd webPage,
here is the code snippet for 2nd webPage,
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
DatabasesViewController *nextController=[[DatabasesViewController alloc]initWithNibName:@"DatabasesViewController" bundle:nil];
[self.navigationController pushViewController:nextController animated:YES];
[nextController changeProductText:[a objectAtIndex:indexPath.row]];
[nextController changeProductText1:[b objectAtIndex:indexPath.row]];
[nextController changeProductText2:[d objectAtIndex:indexPath.row]];
}
when i selects a cell inside tableView,
it navigates to new view, i don’t want to navigate, i want to stay on same page what changes should i do in above function ?
in above function changeProductText,changeProductText1,changeProductText2, are three IBAction and a,b,d are my array names.
- (IBAction) changeProductText:(NSString *)str{
l1=@"http://ipad.appel.com/indexcharts.aspx?id=";
l2=str;
NSString *str1 = [l1 stringByAppendingString:l2];
NSURL *url2=[NSURL URLWithString:str1];
NSURLRequest *req2=[NSURLRequest requestWithURL:url2];
[webView loadRequest:req2];
}
when i click on cell of tableView webView is not displaying,
do i need to clear webpage or reload webpage something like that ?
Help Me Guys, Thanx in Advance !!
I think You can use the UISplitViewController for this issue.
EDIT : Now check out the code like this..