я задал вопрос здесь: Лучшая идея для импорта текста в каждое представление NavigationController
ответ был таким:
- (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];
}
Теперь на PoemDetailsViewController я создаю UIWebView и пишу этот код:
(я знаю, что этот код показывает только один из моих файлов HTML)
NSString *path = [[NSBundle mainBundle] pathForResource:@"fal1" ofType:@"html"];
NSFileHandle *readHandle = [NSFileHandle fileHandleForReadingAtPath:path];
NSString *htmlString = [[NSString alloc] initWithData:
[readHandle readDataToEndOfFile] encoding:NSUTF8StringEncoding];
Теперь я не могу найти связь между этим кодом
poemDetails.poem = [poems objectAtIndex:indexPath.row];
загружать стихи на AnotherViewController с каждой ячейкой?
Я имею в виду, что каждая ячейка показывает свое стихотворение на другом экране с помощью Navigation Controller.