我将textField声明为插座,通过故事板正确连接:
@property (weak, nonatomic) IBOutlet UITextField *addBillEventName;
我还通过代码和故事板设置了UITextfield的代理,代码:
-(void) viewDidAppear:(BOOL)animated {
[self.addBillEventName setDelegate:self];
}
所以你会期待像这样的方法:
-(void) viewDidAppear:(BOOL)animated {
[self.addBillEventName setDelegate:self];
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
NSLog(@"Touch end controller");
}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
NSLog(@"Touch end controller");
}
会触发,但不会触发。奇怪的是charactersInRange
确实有效。
有谁熟悉这个问题?