문제

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.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top