我的項目沒有明顯的錯誤,但是當我嘗試運行它給了以下錯誤遇到奇怪的錯誤運行目標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];
}
感謝名單了很多你解決我的問題:)我忘記了我是創建ConcreteScreen類,並沒有閱讀完整的名字我是不是導入它ContactScreen,但我很奇怪,我被刪除ConcreteScreen爲什麼它仍然顯示ConcellteScreen intellignce :( –