如何在我的应用程序中实现EGOPhotoViewer?

问题描述:

我尝试在我的应用程序来实现EGOPhotoViewer,但是当我尝试运行,我得到这个错误:如何在我的应用程序中实现EGOPhotoViewer?

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    if (indexPath.row == 0) { 

     MyPhoto *photo = [[MyPhoto alloc] initWithImageURL:[NSURL URLWithString:@"http://a3.twimg.com/profile_images/66601193/cactus.jpg"] name:@" laksd;lkas;dlkaslkd ;a"]; 
     MyPhoto *photo2 = [[MyPhoto alloc] initWithImageURL:[NSURL URLWithString:@"https://s3.amazonaws.com/twitter_production/profile_images/425948730/DF-Star-Logo.png"] name:@"lskdjf lksjdhfk jsdfh ksjdhf sjdhf ksjdhf ksdjfh ksdjh skdjfh skdfjh "]; 
     MyPhotoSource *source = [[MyPhotoSource alloc] initWithPhotos:[NSArray arrayWithObjects:photo, photo2, nil]]; 

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


    } else if (indexPath.row == 1) { 

     MyPhoto *photo2 = [[MyPhoto alloc] initWithImageURL:[NSURL URLWithString:@"https://s3.amazonaws.com/twitter_production/profile_images/425948730/DF-Star-Logo.png"] name:@"lskdjf lksjdhfk jsdfh ksjdhf sjdhf ksjdhf ksdjfh ksdjh skdjfh skdfjh "]; 
     MyPhotoSource *source = [[MyPhotoSource alloc] initWithPhotos:[NSArray arrayWithObjects:photo2, nil]]; 

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

    } 
} 

如何:

Ld /Users/alex/Library/Developer/Xcode/DerivedData/EGO-gyjpowmnxxhzmdfmwxqkazhvsjbj/Build/Products/Debug-iphonesimulator/EGO.app/EGO normal i386 
    cd /Developer/iPhone_apps/EGO 
    setenv MACOSX_DEPLOYMENT_TARGET 10.6 
    setenv PATH "/Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Volumes/Xcode/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" 
    /Volumes/Xcode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/alex/Library/Developer/Xcode/DerivedData/EGO-gyjpowmnxxhzmdfmwxqkazhvsjbj/Build/Products/Debug-iphonesimulator -F/Users/alex/Library/Developer/Xcode/DerivedData/EGO-gyjpowmnxxhzmdfmwxqkazhvsjbj/Build/Products/Debug-iphonesimulator -filelist /Users/alex/Library/Developer/Xcode/DerivedData/EGO-gyjpowmnxxhzmdfmwxqkazhvsjbj/Build/Intermediates/EGO.build/Debug-iphonesimulator/EGO.build/Objects-normal/i386/EGO.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -framework QuartzCore -framework MessageUI -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/alex/Library/Developer/Xcode/DerivedData/EGO-gyjpowmnxxhzmdfmwxqkazhvsjbj/Build/Products/Debug-iphonesimulator/EGO.app/EGO 

Undefined symbols for architecture i386: 
    "_OBJC_CLASS_$_MyPhoto", referenced from: 
     objc-class-ref in ViewController.o 
    "_OBJC_CLASS_$_MyPhotoSource", referenced from: 
     objc-class-ref in ViewController.o 
    "_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) 

这个错误,当我写代码的这些线路卡梅斯我解决了它?

+0

我已经回答了你前面的问题。不要两次问同一件事,特别是在我回答之后。 – CodaFi 2012-01-03 02:49:08

我不确定EGOPhotoViewer是什么,但是你没有链接它,因此,当你链接时,链接器(ld)失败,因为它找不到EGOPhotoViewController类。

确认您已经添加了必要的框架

Your project > Your target > Summary > Linked Frameworks and Libraries

  • CoreGraphics.framework
  • QuartzCore.framework
  • MessageUI.framework