hi guys . i had questioned here : http://stackoverflow.com/questions/1675113/best-idea-for-importing-text-to-each-navigationcontroller-view
the answer was this:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
PoemDetailsViewController *poemDetails = [[[PoemDetailsViewController alloc] initWithNibName:@"PoemDetailsViewController" bundle:nil] autorelease];
poemDetails.poem = [poems objectAtIndex:indexPath.row]; // assuming you have a single dimension array with poems and a single table group
[self.navigationController pushViewController:poemDetails animated:YES];
}
now on on the PoemDetailsViewController i create an UIWebView and writing this code :
(i know this code shows only one of my HTML files)
NSString *path = [[NSBundle mainBundle] pathForResource:@"fal1" ofType:@"html"];
NSFileHandle *readHandle = [NSFileHandle fileHandleForReadingAtPath:path];
NSString *htmlString = [[NSString alloc] initWithData:
[readHandle readDataToEndOfFile] encoding:NSUTF8StringEncoding];
now i can't find any associating between this code
poemDetails.poem = [poems objectAtIndex:indexPath.row];
to load poems on the AnotherViewController with each cell ?
i mean is every cells show their poem on the other view with Navigation Controller .