2

単体テストを実行しようとすると、このエラーが発生します。エラー全体は次のとおりです。

    Undefined symbols for architecture i386:
  "_CGImageRelease", referenced from:
      _releaseImages in UIImage+animatedGIF.o
  "_CGImageSourceCopyPropertiesAtIndex", referenced from:
      _delayCentisecondsForImageAtIndex in UIImage+animatedGIF.o
  "_CGImageSourceCreateImageAtIndex", referenced from:
      _createImagesAndDelays in UIImage+animatedGIF.o
  "_CGImageSourceCreateWithData", referenced from:
      +[UIImage(animatedGIF) animatedImageWithAnimatedGIFData:] in UIImage+animatedGIF.o
  "_CGImageSourceCreateWithURL", referenced from:
      +[UIImage(animatedGIF) animatedImageWithAnimatedGIFURL:] in UIImage+animatedGIF.o
  "_CGImageSourceGetCount", referenced from:
      _animatedImageWithAnimatedGIFImageSource in UIImage+animatedGIF.o
  "_kCGImagePropertyGIFDelayTime", referenced from:
      _delayCentisecondsForImageAtIndex in UIImage+animatedGIF.o
  "_kCGImagePropertyGIFDictionary", referenced from:
      _delayCentisecondsForImageAtIndex in UIImage+animatedGIF.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

ここですべての手順を実行しました: http://twobitlabs.com/2011/06/adding-ocunit-to-an-existing-ios-project-with-xcode-4/

また、テスト ターゲットの Build Phrases の「Compile Sources」にライブラリを追加しました。まだ運がありません。

4

2 に答える 2

5

"CoreGraphics.framework" と " ApplicationServices.framework" を単体テストのターゲット メンバーシップに追加する必要があるようです。

ファイルに対して行う方法は次のとおりです。

.m ファイルに対して [ターゲット メンバーシップ] が選択されていることを確認します

左側のファイルとフォルダーのリストで「CoreGraphics.framework」に移動し、単体テスト ターゲットのチェックマークが「オン」になっていることを確認します。

于 2013-09-13T01:52:09.867 に答える
1

ターゲットのビルド フェーズに移動し、ImageIO.frameworkを追加します。

于 2015-08-17T15:07:07.407 に答える