19

我正在努力在我的代码中链接 ALAssetsLibrary。

我在这方面搜索了很多,并遵循了不止一个教程到最后一个点,但我仍然在我开始的地方。

Ld /Users/vedprakash/Library/Developer/Xcode/DerivedData/PickThumb-gmvprlkgmgexedeojbaoeidbadnw/Build/Products/Debug-iphonesimulator/PickThumb.app/PickThumb normal i386
    cd "/Users/vedprakash/Documents/XCode Projects/PickThumb"
    setenv MACOSX_DEPLOYMENT_TARGET 10.6
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/vedprakash/Library/Developer/Xcode/DerivedData/PickThumb-gmvprlkgmgexedeojbaoeidbadnw/Build/Products/Debug-iphonesimulator -F/Users/vedprakash/Library/Developer/Xcode/DerivedData/PickThumb-gmvprlkgmgexedeojbaoeidbadnw/Build/Products/Debug-iphonesimulator -filelist /Users/vedprakash/Library/Developer/Xcode/DerivedData/PickThumb-gmvprlkgmgexedeojbaoeidbadnw/Build/Intermediates/PickThumb.build/Debug-iphonesimulator/PickThumb.build/Objects-normal/i386/PickThumb.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/vedprakash/Library/Developer/Xcode/DerivedData/PickThumb-gmvprlkgmgexedeojbaoeidbadnw/Build/Products/Debug-iphonesimulator/PickThumb.app/PickThumb

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

2 回答 2

38

您需要将AssetsLibrary框架添加到目标的“Link Binary With Libraries”构建阶段PickThumb

如何在 Xcode 4 中“添加现有框架”?

于 2012-06-23T20:13:29.333 回答
7

在 Xcode 10.2 中,我刚刚添加了

AssetsLibrary.framework

在 Target>Build Phases> Link Binary With Libraries 部分

于 2019-06-21T01:12:01.907 回答