1

I have an NSViewController with 4 NSTableViews inside (View based),

enter image description here

all of them have NSTextFields and I want to call a method for triggering an action after editing each of them called

-(void)controlTextDidEndEditing:(NSNotification *)obj{
    NSTextField *textfield = (NSTextField *) [obj object]{}

but for do so, I need to know which NSTableView am I editing, what's the proper way to get that information

Jesus
  • 8,456
  • 4
  • 28
  • 40

1 Answers1

1

with this:

-(void)tableViewSelectionIsChanging:(NSNotification *)notification{

    MyTableView *tableView = (MyTableView *)[notification object];

    if (tableView == _tableView1) { NSLog(@"_tableView1"); }
    if (tableView == _tableView2) { NSLog(@"_tableView2"); }
    if (tableView == _tableView3) { NSLog(@"_tableView3"); }
    if (tableView == _tableView4) { NSLog(@"_tableView4"); }   
}
Jesús Ayala
  • 2,743
  • 3
  • 32
  • 48