使用UIPageViewController的简单pdf查看器

时间:2013-03-31 15:30:02

标签: ios xcode pdf storyboard uipageviewcontroller

我有问题。 我正在尝试创建一个简单的应用程序来查看带有UIPageViewController的pdf,但我无法使其正常工作。

我尝试使用下面github页面上列出的项目。

https://github.com/jackhumphries/UIPageViewController-PDF

但我习惯使用StoryBoards,但我无法使用StoryBoards

我使用以下代码创建了一个按钮:

NSString *path = [[NSBundle mainBundle] pathForResource:@"mhm" ofType:@"pdf"];
PageViewController *page = [[PageViewController alloc] initWithPDFAtPath:path];
[self presentViewController:page animated:YES completion:NULL];

我收到以下错误:

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_PageViewController", referenced from:
      objc-class-ref in PDFPageViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

当我删除最后两行时,我的项目正在运行,但您可以想象我的pdf没有显示。

我尝试在故事板中创建单独的视图,但我无法让它工作。

1 个答案:

答案 0 :(得分:-1)

NSString *path = [[NSBundle mainBundle] pathForResource:@"mhm" ofType:@"pdf"];
    UIPageViewController *page = [[UIPageViewController alloc] initWithPDFAtPath:path];
    [self presentViewController:page animated:YES completion:nil];

试试这个