2012-08-05 156 views
0

我正在處理簡單的應用程序,並且在編寫代碼時沒有錯誤,但是當我推送生成按鈕時,發生錯誤。構建myProject:失敗,xCode向我顯示兩條錯誤警告。這裏的錯誤消息:Xcode項目構建:失敗

Ld /Users/MacUser/Library/Developer/Xcode/DerivedData/Calculator-azorstixlscpikfhurtxwvvwachh/Build/Products/Debug-iphonesimulator/Calculator.app/Calculator normal i386 
cd "/Users/MacUser/Downloads/Downloads/Desktop/old drop box/calc/Calculator" 
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/MacUser/Library/Developer/Xcode/DerivedData/Calculator-azorstixlscpikfhurtxwvvwachh/Build/Products/Debug-iphonesimulator 
-F/Users/MacUser/Library/Developer/Xcode/DerivedData/Calculator-azorstixlscpikfhurtxwvvwachh/Build/Products/Debug-iphonesimulator 
-filelist /Users/MacUser/Library/Developer/Xcode/DerivedData/Calculator-azorstixlscpikfhurtxwvvwachh/Build/Intermediates/Calculator.build/Debug-iphonesimulator/Calculator.build/Objects-normal/i386/Calculator.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 
-framework UIKit -framework Foundation -framework CoreGraphics 
-o /Users/MacUser/Library/Developer/Xcode/DerivedData/Calculator-azorstixlscpikfhurtxwvvwachh/Build/Products/Debug-iphonesimulator/Calculator.app/Calculator 

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

我找到了,這是我Controller.m或者代碼:

#import "AxesView.h" 
#import "AxesDrawer.h" 

@implementation AxesView 


- (void)drawRect:(CGRect)rect 
{ 
    CGRect b; 
    b = self.bounds; 
    CGPoint aO; 
    aO = b.origin; 
    CGFloat pPU; 
    pPU = b.size.height; 

    [AxesDrawer drawAxesInRect:(CGRect)b originAtPoint:(CGPoint)aO scale:(CGFloat)pPU]; 
} 
@end 

我想在我AxesDrawer.h文件中的問題,但我不知道爲什麼。如果我從AxesDrawer.h更改爲AxesDrawer.m(我知道這是錯誤的,但僅用於測試) 該項目將建立並在模擬器中工作。有人可以幫助我嗎?我做錯了什麼?

回答

3

AxesDrawer.m可能不在您的目標中。點擊它並使用最右側的工具面板,並確保檢查了您正在構建的目標。

+0

你是對的,謝謝,我是iOS開發新手。謝謝。 – user748634 2012-08-05 12:54:29