2012-06-14 50 views
0

我的項目沒有明顯的錯誤,但是當我嘗試運行它給了以下錯誤遇到奇怪的錯誤運行目標C代碼

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

我用我的ContactScreen類ViewController.m

我試圖通過@class ContactScree和#進口"ContactScreen.h"

,並在我的ViewController我使用它作爲[ContactScreen myMethod]; 當我註釋掉該行它正常工作,但現在它給編譯時錯誤:( 昨天有人wroking罰款

這裏是我的代碼

#import "ViewController.h" 


#import "ConcreteScreen.h" 
@interface ViewController() 

@end 

@implementation ViewController 




-(IBAction)btnContactPress:(id)sender{ 
    NSLog(@"Contact Screen"); 

    ConcreteScreen *coontact = [[ConcreteScreen alloc]init]; 

} 

回答

2

你一頭霧水ConcreteScreenContactScreen和編譯器告訴你,這是不知道有關ConcreteScreen

+0

感謝名單了很多你解決我的問題:)我忘記了我是創建ConcreteScreen類,並沒有閱讀完整的名字我是不是導入它ContactScreen,但我很奇怪,我被刪除ConcreteScreen爲什麼它仍然顯示ConcellteScreen intellignce :( –

1

確保您的.m文件中包含該項目。可以創建它,使用標題和所有內容,但它不會進入構建。它也需要在目標中。