2

我收到了来自 Xcode 的这条消息

Ld /Users/myUsername/Library/Developer/Xcode/DerivedData/myApp-gqsubryokdmrjmczxeqypzcgpths/Build/Intermediates/myApp.build/Debug-iphoneos/myApp.build/Objects-normal/armv7/myApp normal armv7
    cd /Users/myUsername/Documents/_IPAD/myApp
    setenv IPHONEOS_DEPLOYMENT_TARGET 4.3
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"


/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -L/Users/myUsername/Library/Developer/Xcode/DerivedData/myApp-gqsubryokdmrjmczxeqypzcgpths/Build/Products/Debug-iphoneos -F/Users/myUsername/Library/Developer/Xcode/DerivedData/myApp-gqsubryokdmrjmczxeqypzcgpths/Build/Products/Debug-iphoneos -filelist /Users/myUsername/Library/Developer/Xcode/DerivedData/myApp-gqsubryokdmrjmczxeqypzcgpths/Build/Intermediates/myApp.build/Debug-iphoneos/myApp.build/Objects-normal/armv7/myApp.LinkFileList -dead_strip -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=4.3 -framework AudioToolbox -framework SystemConfiguration -framework QuartzCore -framework OpenAL -framework CoreGraphics -framework CFNetwork -framework MessageUI -framework CoreData -framework AVFoundation -framework StoreKit -framework UIKit -framework Foundation -o /Users/myUsername/Library/Developer/Xcode/DerivedData/myApp-gqsubryokdmrjmczxeqypzcgpths/Build/Intermediates/myApp.build/Debug-iphoneos/myApp.build/Objects-normal/armv7/myApp



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

究竟是什么没有找到?如果它说没有找到东西,在哪里寻找这个没有找到的东西?或者换句话说,如果 xcode 正在搜索它在某处搜索的东西,在哪里搜索什么?

4

3 回答 3

11

ViewController未找到该对象,它在 中被引用AppDelegate。您没有将 ViewController 链接到您的应用程序中。检查您的项目中的Compile Sources部分是否Build Phases显示ViewController.m.

在此处输入图像描述

于 2012-09-21T00:01:31.173 回答
1

我刚碰到这个。原来我没有将新源添加到所有需要它的目标中。也许这会对将来的某人有所帮助.. :)

于 2015-01-06T01:01:30.530 回答
0

将 xCode 6beta 更新到 xCode 6.0.1 后,我遇到了同样的错误。在花了很多时间后,我通过从Window -> Organizer -> Projects -> #Select project#中删除“ Derived Data ”来修复它,然后在“Derived Data”中按 Delete。

于 2014-09-19T12:43:19.393 回答