2010-06-08 110 views
0

我的UItouches未在我的幻燈片nib文件中檢測到。問題是什麼?誰能幫忙?未檢測到UITouches


@class Slideshow; 
@interface RootViewController : UIViewController{ 
PreferencesController *preferencesController; 
Slideshow *slideshow;} 

幻燈片實施

@implementation Slideshow 
- (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event 
{ 
NSLog(@"touches begin"); 
} 
- (void)viewDidLoad 
{ 

UIImageView *frontView = [[UIImageView alloc] initWithFrame:self.view.bounds]; 
frontView.backgroundColor = [UIColor blackColor]; 
frontView.image = [UIImage imageNamed:@"apple.png"]; 
frontView.userInteractionEnabled = YES; 

[self.view addSubview:frontView]; 

[frontView release]; 
}@end 
+0

什麼類型的幻燈片?它是否從UIResponder繼承? – 2010-06-08 05:56:37

回答

0

幻燈片是一個UIViewControllertouchesBegan只叫上UIView。您需要繼承UIView以捕捉觸摸。

+0

對不起,我對xcode很陌生。那麼應該將哪些代碼添加到我的當前代碼中以區分UIView? – Tony 2010-06-08 14:01:23