2012-08-29 64 views
2

我是新iPhone開發者。我有這個錯誤。Xcode error in linker

Ld /Users/c4ntechnology/Library/Developer/Xcode/DerivedData/iPatientCare-azwpvvrjjoaoygfcfqiicwkyssya/Build/Products/Debug-iphonesimulator/iPatientCare.app/iPatientCare normal i386 cd /Users/c4ntechnology/Desktop/iPatientCare setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.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 i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/c4ntechnology/Library/Developer/Xcode/DerivedData/iPatientCare-azwpvvrjjoaoygfcfqiicwkyssya/Build/Products/Debug-iphonesimulator -F/Users/c4ntechnology/Library/Developer/Xcode/DerivedData/iPatientCare-azwpvvrjjoaoygfcfqiicwkyssya/Build/Products/Debug-iphonesimulator -filelist /Users/c4ntechnology/Library/Developer/Xcode/DerivedData/iPatientCare-azwpvvrjjoaoygfcfqiicwkyssya/Build/Intermediates/iPatientCare.build/Debug-iphonesimulator/iPatientCare.build/Objects-normal/i386/iPatientCare.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -lsqlite3 -framework UIKit -framework AVFoundation -framework CoreGraphics -o /Users/c4ntechnology/Library/Developer/Xcode/DerivedData/iPatientCare-azwpvvrjjoaoygfcfqiicwkyssya/Build/Products/Debug-iphonesimulator/iPatientCare.app/iPatientCare

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

"_OBJC_CLASS_$_ViewController", referenced from:

clang: error: linker command failed with exit code 1 (use -v to see invocation)

請幫我

+0

看起來你錯過了一個框架。 –

+0

你有一個叫做ViewController的類嗎?如果你這樣做,將其導入AppDelegate。如果您不從AppDelegate中移除對ViewController的引用。 –

回答

5

此編譯器錯誤意味着你AppDelegate類引用在項目中ViewController類,但ViewController目前尚未建立被編譯幷包括在最終產品。

爲了確保ViewController類包含在最終產品中,選擇左上欄藍色的Xcode項目圖標一樣顯示在下面的圖片:

enter image description here

然後在選擇目標然後選擇Build Phases選項卡,並確保ViewController.mAppDelegate.m一起包含在列表中,以及其他顯示的內容。要添加它,如果它現在不存在,可以拖動它最左邊一列的圖標並將其放到編譯源表格視圖中,或者單擊該表格視圖底部的+按鈕。

0

的UIKit的類叫做UIViewController,你最有可能缺少 「UI」 的一部分。您必須導入<UIKit/UIKit.h>以使用此課程,但它很可能已包含在您的MyApp-Prefix.pch中。如果視圖控制器是一個類你自己的,你必須:

#import "ViewController.h"