In diesem Code wird in der viewDidLoad ein Link für den Anfang der WebView geladen
Es ist dann möglich über 3 verschiedene Buttons die Links in der WebView zu ändern
Wäre folgendes möglich, wenn ja, wie?
Statt den 3 UIButtons 3 cells, also eine TableView zu erstellen?
Also dass ich dann über die TableView(Cell) den Link in der WebView verändere
Alles anzeigen
Es ist dann möglich über 3 verschiedene Buttons die Links in der WebView zu ändern
Wäre folgendes möglich, wenn ja, wie?
Statt den 3 UIButtons 3 cells, also eine TableView zu erstellen?
Also dass ich dann über die TableView(Cell) den Link in der WebView verändere
C-Quellcode
- - (void)viewDidLoad
- {
- [super viewDidLoad];
- // Get the path of the resource file
- NSString* path = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"news/en/"];
- // Convert it to the NSURL
- NSURL* address = [NSURL fileURLWithPath:path];
- // Create a request to the resource
- NSURLRequest* request = [NSURLRequest requestWithURL:address];
- //Load the request in the UIWebView.
- [self->webbilder2 loadRequest:request];
- }
- -(IBAction)link1 {
- // Get the path of the resource file
- NSString* path = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"news/ge/"];
- // Convert it to the NSURL
- NSURL* address = [NSURL fileURLWithPath:path];
- // Create a request to the resource
- NSURLRequest* request = [NSURLRequest requestWithURL:address];
- //Load the request in the UIWebView.
- [self->webbilder2 loadRequest:request];
- }
- -(IBAction)link2 {
- // Get the path of the resource file
- NSString* path = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"news/fr/"];
- // Convert it to the NSURL
- NSURL* address = [NSURL fileURLWithPath:path];
- // Create a request to the resource
- NSURLRequest* request = [NSURLRequest requestWithURL:address];
- //Load the request in the UIWebView.
- [self->webbilder2 loadRequest:request];
- }
- -(IBAction)link3 {
- // Get the path of the resource file
- NSString* path = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"news/ar/"];
- // Convert it to the NSURL
- NSURL* address = [NSURL fileURLWithPath:path];
- // Create a request to the resource
- NSURLRequest* request = [NSURLRequest requestWithURL:address];
- //Load the request in the UIWebView.
- [self->webbilder2 loadRequest:request];
- }