#import "ECSlidingViewController.h"
-(void)Loadwebview:(NSURL *)url;
-(void)Loadwebview:(NSURL *)url
{
// NSURL *testURL = [NSURL URLWithString:@"http://www.google.com"];
NSLog(@"loadwebview: %@", url);
[webViewBox loadRequest:[NSURLRequest requestWithURL:url]];
}
#import "mainViewController.h"
#import "ECSlidingViewController.h"
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *urlString = [[dao libraryItemAtIndex:indexPath.row] valueForKey:@"url"];
NSURL *url = [NSURL URLWithString:@"http://www.google.com"]; //urlString];
NSLog(@"selected url: %@", url);
mainViewController *mvc = [[mainViewController alloc]init];
[mvc Loadwebview:url];
//NSLog(@"%@", [[dao libraryItemAtIndex:indexPath.row] valueForKey:@"url"]);
[self.slidingViewController resetTopView]; //it will show mainViewController
}
此代码无效... OutPut步骤是, 日志显示:
选择的网址:http://www.google.com
loadwebview:http://www.google.com
这意味着我将网址从leftViewController.m
传递到mainViewController.m
并正确调用loadwebview
。但问题是webViewBox
未打开请求的网址。
: - (