0

Added detailed info

I have two Windows.(mainWindow and childWindow.) On the top of the mainWindow I added childwindow using WindowController using the following Code, so that the childwindow is always on the top of mainWindow.

[[childWindowController window]setLevel:NSModalPanelWindowLevel];

In the ChildWindow I have a tableView,When I doubleclick on this tableView row I would like to update the tableview in the mainWindow. I used the following api of tableview for editing.

-(void)editColumn:(NSInteger)columnIndex row:(NSInteger)rowIndex withEvent:(NSEvent *)theEvent select:(BOOL)flag

After that I would like edit the contents of the tableview in the mainWindow. I am not able get the keyboard focus in the tableviewcell as the 'childWindow' is always the 'FirstResponder'.

How would I make the tableview in the 'mainWindow' as the FirsResponder or is there any way to get the 'keyboardfocus' in the tableviecell of the 'mainwindow'

Ram
  • 1,872
  • 5
  • 31
  • 54
  • 1
    I don't think ["Field Editor"](http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/TextEditing/Tasks/FieldEditor.html) means what you think it means. Could you add some detail to what you're trying to do? Maybe a graphical description? – jscs Nov 28 '11 at 19:31
  • Now Iam able to get the fieldEditor in the tableviewcell using the following code NSText * currentEditor = [tableView currentEditor]; [mainWindow makeFirstResponder: currentEditor]; [currentEditor setSelectedRange: NSMakeRange([[currentEditor string] length],0)]; – Ram Nov 29 '11 at 13:32
  • I need to implement the textDidEndEditing Delegate. If I implement this one setObjectValue of tableview delegate is not getting called. How can I make the both things work together. – Ram Nov 29 '11 at 13:36

1 Answers1

0

Forgot to call [super textDidEndEditing]. This solved the issue.

Yuck
  • 49,664
  • 13
  • 105
  • 135
Ram
  • 1,872
  • 5
  • 31
  • 54