我使用"成为第一个响应者"在tv2,但任何文本输入到tv1。如何在此设置中将其设置为tv2。
- (void)viewDidLoad {
[super viewDidLoad];
tv1 = [[NSTextView alloc] initWithFrame:CGRectMake(0, 0, 100, 50)];
[self.view addSubview:tv1];
tv1.string = @"dog";
tv2 = [[NSTextView alloc] initWithFrame:CGRectMake(200, 0, 100, 50)];
[self.view addSubview:tv2];
tv2.string = @"cat";
[tv2 becomeFirstResponder]; //fails to make this one take in keys strokes