我正在尝试测试一些 NSTextFields 的变化。
我在用着:
- (void)controlTextDidEndEditing:(NSNotification *)notification {
if ([notification object] == field1)
NSLog(@"field1: stringValue == %@", [field1 stringValue]);
if ([notification object] == field2)
NSLog(@"field2: stringValue == %@", [field2 stringValue]);
if ([notification object] == field3)
NSLog(@"field3: stringValue == %@", [field3 stringValue]);
}
这行得通,但我想知道是否有更好的方法。谢谢