2012-07-05 228 views
0

hy all, 我正在構建一個應用程序來創建一個簡單的tableview,並在頂部的搜索欄中搜索表格的元素。 我按照一個教程,並沒有發現編碼錯誤,但是建立的時候,它總是失敗,則會顯示以下消息:爲i386硬件架構Xcode 4.3.3 - 錯誤未定義符號

Ld /Users/gouyoun/Library/Developer/Xcode/DerivedData/ERCDictionnary-atjolczeormaykcscwvnhlxdcnvk/Build/Products/Debug-iphonesimulator/ERCDictionnary.app/ERCDictionnary normal i386 
cd /Users/gouyoun/Desktop/ERCDictionnary/ERCDictionnary 
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/gouyoun/Library/Developer/Xcode/DerivedData/ERCDictionnary-atjolczeormaykcscwvnhlxdcnvk/Build/Products/Debug-iphonesimulator -F/Users/gouyoun/Library/Developer/Xcode/DerivedData/ERCDictionnary-atjolczeormaykcscwvnhlxdcnvk/Build/Products/Debug-iphonesimulator -filelist /Users/gouyoun/Library/Developer/Xcode/DerivedData/ERCDictionnary-atjolczeormaykcscwvnhlxdcnvk/Build/Intermediates/ERCDictionnary.build/Debug-iphonesimulator/ERCDictionnary.build/Objects-normal/i386/ERCDictionnary.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 UIKit -framework Foundation -framework CoreGraphics -o /Users/gouyoun/Library/Developer/Xcode/DerivedData/ERCDictionnary-atjolczeormaykcscwvnhlxdcnvk/Build/Products/Debug-iphonesimulator/ERCDictionnary.app/ERCDictionnary 

未定義的符號: 「_OBJC_CLASS _ $ _ OverlayViewController」,從引用: objc -class-REF在tableView.o LD:符號(S)沒有找到i386硬件架構 鐺:錯誤:連接命令,退出代碼1失敗(使用-v看到調用)

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

我OBjective C中的一個新詞,有任何想法嗎?

+0

你可以顯示錯誤發生的行嗎? – Sabbath 2012-07-05 09:47:54

+0

@安息日這是一個鏈接錯誤。沒有特定的代碼行。 – 2012-07-05 09:57:15

+0

在'顯示問題導航器'中,您可以看到一個顯示爲紅色圓圈的圖標的構建錯誤,對嗎? – Sabbath 2012-07-05 10:01:43

回答

0

它完成,它只需要刪除的文件並重新添加之後他們,這工作就像一個魅力

0

您的tableView類引用了一個名爲OverlayViewController的類,它不在您的項目中。

+0

不,我的項目中有OverlayViewController.h和OverlayViewController.m文件 – 2012-07-05 08:52:55

+0

這就是錯誤所說的。嘗試清理構建並重新編譯。檢查OverlayViewController.m是否包含在您的目標中。 – 2012-07-05 09:03:28

+0

或類名在文件中有錯字。 – eugene 2012-07-05 09:11:15

0

我有完全相同的錯誤。它發生是因爲我打開了2個xCode項目,拖動了一個類從一個項目到另一個項目。我選中了「複製到項目」以及新項目文件夾中的文件。但它每次都會崩潰。

我刪除了類和將其導入他們到項目中,然後它工作...所以使用Drag'n'Drop時要小心!