我的项目没有可见错误,但是当我尝试运行时,出现以下错误
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.h"
[ContactScreen myMethod];
当我注释掉这一行时,它工作正常,但现在却给出了编译时错误:(#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
https://stackoverflow.com/questions/11039014/