Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello,
Can anyone help with this?

I need to display a local html file when it's name is called from an NSMutable array. (code below)

I am using UIwebview. The name of the file is a string that should be read from the array like this:
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"%@" ofType:@"html"] isDirectory:NO]]];

pathForResource:@"%@" is the string to be read from the array eg January string, so I want January.html to open if selected in table, or February.html if selected.

How can I get the string from the array (when clicked in tablerow) to replace the @"%@" in the pathForResource

Thank you anyone who can help
C#
(void)setDetailItemid)newDetailItem {
if (detailItem != newDetailItem) {
[detailItem release];
detailItem = [newDetailItem retain];

//Update the view:
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle
mainBundle] pathForResource:@"%@" ofType:@"html"] isDirectory:NO]]];
[self configureView];
}
Posted
Updated 3-Feb-11 20:44pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900