2

I am using QLPreviewController for displaying documents, to remove the share button i am subclassing QLPreviewController like below,

@interface QuickLookViewController : QLPreviewController{

}

And i am using the class as Below

QuickLookViewController *previewer = [[QuickLookViewController alloc] init];
// Set data source
[previewer setDataSource:self];
// Which item to preview
[previewer setCurrentPreviewItemIndex:indexPath.row];
// Push new viewcontroller, previewing the document
[[self navigationController] pushViewController:previewer animated:YES];

But the data source methods are not calling.

Can any one help me.

JOM
  • 8,139
  • 6
  • 78
  • 111
kiri
  • 1,977
  • 5
  • 27
  • 55

1 Answers1

0

Your interface has to tell that it's implementing the callbacks

@interface QuickLookViewController : QLPreviewController
<QLPreviewControllerDataSource, QLPreviewControllerDelegate>

Add the protocal names inside arrow brackets after the class name

JOM
  • 8,139
  • 6
  • 78
  • 111