我不完全理解下面的警告。我相信这与在 TableView 控制器中使用 ReaderView 委托和模式表示有关,但这是我的猜测。我尝试使用带有可重用单元的视图控制器进行重建,但继续收到警告。下面是我的代码。对如何解决此警告的问题和建议的任何见解将不胜感激?
编译器说:
警告:从不兼容的类型“PdfVPTableViewController *const_strong”分配给“id ReaderViewControllerDelegate”
我的代码:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
int row = [indexPath row];
NSArray * path4 = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString * path5 = [path4 objectAtIndex:0];
NSString *path6 = [path5 stringByAppendingPathComponent:_pdfList[row]];
if([[NSFileManager defaultManager] fileExistsAtPath:path6]) {
ReaderDocument *document = [ReaderDocument withDocumentFilePath:path6 password:nil];
if (document != nil)
{
ReaderViewController *readerViewController = [[ReaderViewController alloc] initWithReaderDocument:document];
readerViewController.delegate = self;
readerViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
readerViewController.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:readerViewController animated:YES completion:nil];
}
} else {UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"File Problem, Select Another Photo Page" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[message show];
}
}
- (void)dismissReaderViewController:(ReaderViewController *)viewController {
[self dismissViewControllerAnimated:YES completion:nil];
}