实施EGOPhotoViewer时出错

时间:2012-10-16 13:12:21

标签: iphone ios

我的错误看起来像这样。

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

"_OBJC_CLASS_$_EGOPhotoViewController", referenced from:
Objc-class-ref in ViewController.o
Symbol(s) not found for architecture i386
Linker command failed with exit code 1 (use -v to see invocation)

我创建了一个ViewController并在该控制器中创建了一个按钮 代码是

- (IBAction)galleryBtnTapped:(id)sender {
    MyPhoto *photo = [[MyPhoto alloc] initWithImageURL:[NSURL URLWithString:@"http://a3.twimg.com/profile_images/66601193/cactus.jpg"] name:@" First Photo"];
    MyPhoto *photo2 = [[MyPhoto alloc] initWithImageURL:[NSURL URLWithString:@"https://s3.amazonaws.com/twitter_production/profile_images/425948730/DF-Star-Logo.png"] name:@"Second Photo"];
    MyPhotoSource *source = [[MyPhotoSource alloc] initWithPhotos:[NSArray arrayWithObjects:photo, photo2, photo, photo2, photo, photo2, photo, photo2, nil]];

    EGOPhotoViewController *photoController = [[EGOPhotoViewController alloc] initWithPhotoSource:source];
    [self.navigationController pushViewController:photoController animated:YES];

    //[photoController release];
    //[photo release];
    //[photo2 release];
    //[source release];
}

和github

中的project相同

2 个答案:

答案 0 :(得分:0)

enter image description here请在编译来源>中设置 -fno-objc-arc 标记。 EGoPhotoViewer.m 位于以下路径

点击您的项目>目标项目(不选择项目测试)>编译源> EGoPhotoViewer.m

答案 1 :(得分:-1)

看起来你没有链接正确的二进制文件。要将二进制文件包含到项目中,您必须单击项目文件以显示目标。从那里,转到“构建阶段”选项卡,在“使用库链接二进制”下,确保您的EGOPhotoViewer库在那里。

以下是它的外观截图: enter image description here