2012-01-01 63 views
-1

我嘗試在我的應用程序來實現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

回答

0

我不確定EGOPhotoViewer是什麼,但是你沒有鏈接它,因此,當你鏈接時,鏈接器(ld)失敗,因爲它找不到EGOPhotoViewController類。

0

確認您已經添加了必要的框架

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

  • CoreGraphics.framework
  • QuartzCore.framework
  • MessageUI.framework
相關問題