开发者

passing user from UITableView to UIWebView based on selection

开发者 https://www.devze.com 2022-12-18 08:46 出处:网络
I\'m trying to pass the user on to the int开发者_开发问答erface based on their cell selection in the UITableView, ie, if the user selects cell 1, they are taken to view model 2, containing UIWebView.

I'm trying to pass the user on to the int开发者_开发问答erface based on their cell selection in the UITableView, ie, if the user selects cell 1, they are taken to view model 2, containing UIWebView. UIWebView then displays local file, cell1.html.

Currently, I've manage to get placeholder using:

selectedCellText.text = selectedCell;

to display the name of the cell selected. How do I get it to directly pass to the UIWebView, stick UIWebView in the interface and link it using:

UIWebView *myWebView = [[UIWebView alloc] initWithFrame:frame];
NSBundle *mainBundle = [NSBundle mainBundle];
NSString *stringUrl = [mainBundle pathForResource:@"selectedCell" ofType:@"html"];
NSURL *baseUrl = [NSURL fileURLWithPath:stringUrl];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:baseUrl];

[myWebView loadRequest:urlRequest];

My other issue is that some of the cell names have spaces in them, and for simplicity, I'd like to ensure that there are no spaces (actually, will it even work with spaces in the name, I assume with %20 ?

Thanks


Fixed by flowing table -> html page

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号