views:

213

answers:

1

So I have a UIWebView implemented in one .m file and a UITableView implemented in another. When a user clicks UITableView element, the UIWebView appears. The problem is that I have to set UIWebView's content (local text and images) depending on the UITableView's row number. I know how to do this, but this, of course must be implemented with the UITableView but it also needs UIWebView.

Just importing the UIWebView implementation does'n work.

Thanks in advance!

A: 

see this link to for setting delegates here

In didSelectRowAtIndexpath

 NSString *name=@"content of table";
 myAppDelegate *appDelegate = (myAppDelegate *) [[UIApplication sharedApplication] delegate];
    [appDelegate setCurrentTitle:name]; 

PictureWebViewController *webview = [[PictureWebViewController alloc] initWithNibName:@"PictureWebViewController" bundle:nil];


[self.navigationController pushViewController:email animated:YES];

the PictureWebViewController is class of your webview .

In that class in viewdidload method get the title as

  myAppDelegate *appDelegate = (myAppDelegate *) [[UIApplication sharedApplication] delegate];
  NSString *name= [appDelegate getCurrentTitle];

Use the name in this class to display the content in webview.

All the Best

Warrior
Thank you so much!
Knodel