我有6个文本字段,我想知道对此方法的哪个字段响应 我无法将textView传输到textfield,我该怎么办?
(BOOL)control:(NSControl *)control
textView:(NSTextView *)textView
doCommandBySelector:(SEL)commandSelector{
NSLog(@"commandSelector : %@",NSStringFromSelector(commandSelector));
//insertTab: -键入tab
//insertNewline: -键入回车
//deleteBackward
MSSingleField *field = (MSSingleField *)textView;
if ([NSStringFromSelector(commandSelector) isEqualToString:@"deleteBackward:"])
{
if (field.lastKeyView) {
[field.lastKeyView becomeFirstResponder];
}
}
return NO;
}
答案 0 :(得分:1)
control
参数是文本字段。