Я бы хотел, чтобы мои файлы из моего каталога документов iOS (файлы перечислены в моем UITableView) были доступны, поэтому при нажатии UIWebView загрузит этот файл (в автономном режиме).
Как я могу это сделатьэто?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *pathForYourFile = [documentsDirectory stringByAppendingPathComponent:[filePathsArray objectAtIndex:indexPath.row]]; [yourWebView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:pathForYourFile ofType:@"html"]isDirectory:NO]]]; }
См. Этот документ, чтобы узнать форматы файлов, поддерживаемые UIWebView
http://developer.apple.com/library/ios/#qa/qa1630/_index.html