2012-03-10 2 views
0

수퍼 클래스 UIController를 사용하여 사용자 정의 수퍼 클래스 UIControllerDebug를 작성합니다.UIViewController를 사용하여 UIViewControllerDebug 하위 클래스를 만들려면 어떻게해야합니까?

그리고이 클래스를 다른 하위 클래스와 함께 사용합니다. 다음과 같이 충돌합니다.

Undefined symbols for architecture i386: 
    "_OBJC_METACLASS_$_UIViewControllerDebug", referenced from: 
     _OBJC_METACLASS_$_Main in Main.o 
    "_OBJC_CLASS_$_UIViewControllerDebug", referenced from: 
     _OBJC_CLASS_$_Main in Main.o 
ld: symbol(s) not found for architecture i386 
collect2: ld returned 1 exit status 

무엇이 무언지? 당신이 당신의 소스 코드에서 UIViewControllerDebug@implementation이없는

#import "UIViewControllerDebug.h" 
@implementation UIViewControllerDebug 
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ 
    Output(@"[v]%@ touchesBegan",NSStringFromClass([self class])); 
} 
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ 
    Output(@"[v]%@ touchesBegan",NSStringFromClass([self class])); 
} 
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ 
    Output(@"[v]%@ touchesBegan",NSStringFromClass([self class])); 
} 
@end 
+0

일부 코드 게시 : – janusbalatbat

+0

지금 코드를 게시합니다. – zszen

답변

0

어느 .H

#import <UIKit/UIKit.h> 
@interface UIViewControllerDebug : UIViewController 
@end 

하는 .m, 또는 UIViewControllerDebug@implementation이 아닌 포함 된 파일 :

여기 코드 타겟의 "Build Phases"탭에있는 "Compile Sources"섹션에 나열되어 있습니다.

+0

다른 사람들과 거래합니다. 하지만 UIView 및 UIViewController 문제가 있습니다. – zszen

+0

"나는 다른 사람들을 상대한다"는 것은 무엇을 의미합니까? –

+0

은 NSObject를 상속합니다. 잘 작동한다. – zszen

관련 문제