passing user from UITableView to UIWebView based on selection
Posted
by ct2k7
on Stack Overflow
See other posts from Stack Overflow
or by ct2k7
Published on 2010-01-23T14:52:12Z
Indexed on
2010/03/22
1:21 UTC
Read the original article
Hit count: 452
iphone-sdk-3.0
Hello, I'm trying to pass the user on to the interface 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
© Stack Overflow or respective owner