2012-03-10 3 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 

何が嫌なの?

ここでコード:

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

.M

#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

は、あなたのソースコードにUIViewControllerDebug@implementationを持っていないのどちらか、またはUIViewControllerDebug@implementationを含むファイルではありません.H ターゲットの「ビルド段階」タブの「ソースのコンパイル」セクションにリストされています。

+0

他扱いです。 UIViewとUIViewControllerにのみ問題があります。 – zszen

+0

「他人として扱う」とはどういう意味ですか? –

+0

はNSObjectを継承しています。それはうまくいく。 – zszen

関連する問題