スーパークラス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
投稿コード: – janusbalatbat
私は今コードを投稿します。 – zszen