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

什麼是渴望?

代碼在這裏: .H

#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 2012-03-10 07:31:16

+0

我現在發佈代碼。 – zszen 2012-03-10 07:42:33

回答

0

要麼你沒有的UIViewControllerDebug@implementation在源代碼中,或者包含的UIViewControllerDebug@implementation不是文件列在目標的「Build Phases」選項卡的「Compile Sources」部分中。

+0

我作爲其他人處理。但只有UIView和UIViewController有問題。 – zszen 2012-03-10 07:44:54

+0

「我作爲他人處理」是什麼意思? – 2012-03-10 07:57:34

+0

就像繼承NSObject一樣。它運作良好。 – zszen 2012-03-10 08:48:26

相關問題