别的不多说上代码
#pragma mark Quick Look Data Source
- (NSInteger) numberOfPreviewItemsInPreviewController: (QLPreviewController *) controller {
return [files count];
}
- (id <QLPreviewItem>) previewController: (QLPreviewController *) controller previewItemAtIndex: (NSInteger) index {
return [self urlForFile:[files objectAtIndex: index]];
}
(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
QLPreviewController * ql = [[[QLPreviewController alloc] init] autorelease];
ql.dataSource = self;
ql.currentPreviewItemIndex = indexPath.row;
[self.navigationController pushViewController:ql animated:YES];
}