【发布时间】:2010-02-23 10:59:53
【问题描述】:
在那个视图控制器中,我实现了“touchesBegan:withEvent:”方法,但只有当我触摸视图底部的栏时才会触发该方法,当我触摸桌子时没有任何反应。
我怎样才能改变这种行为,以便能够检测到表格中发生的触摸?
这是基本上声明 UIViewController 的代码:
#import <Foundation/Foundation.h>
#import <QuartzCore/QuartzCore.h>
@interface TripSearchDetailViewController : UIViewController
{
//Parent of this sub-view.
UIViewController *parentController;
//GUI elements
UITableView *tableView;
UIButton *backButton;
}
//Button actions
- (IBAction) goBack:(id) sender;
- (IBAction) showDatePicker:(id) sender;
//Class Methods.
- (void) presentDatePicker;
@property (nonatomic, retain) UIViewController *parentController;
@property (nonatomic, retain) IBOutlet UITableView *tableView;
@property (nonatomic, retain) IBOutlet UIButton *backButton;
@end
【问题讨论】:
标签: iphone cocoa-touch uiview uiviewcontroller