나는 간단한 프로젝트를 가지고 있으며, 기본적 으로 다음을 수행 ViewController.m
하여 다른 프로젝트 로 이동하려고합니다 UIViewController
.
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
...
}
- (void)addAlarmBrick {
NewAlarmViewController *navc = [[NewAlarmViewController alloc] init];
[self presentViewController:navc animated:YES completion:nil];
}
.m
대상 멤버십에 나열된 파일 과 함께 프로젝트에 NewAlarmViewController가 있습니다 .
다음은 전체 오류 메시지입니다.
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_NewAlarmViewController", referenced from:
objc-class-ref in ViewController.o ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
여기서 내가 뭘 잘못하고 있니?
편집하다:
두 파일에 대한 설정 추가 :
.m 파일 :
.h 파일 :
글쎄, 오류가 관련 파일에 다음을 추가하지 않은 것으로 밝혀졌습니다.
@implementation NewAlarmViewController
@end
@implementation이 왜 추가되어야하는지 모르겠지만 그래야만합니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다