0
votes

I had the suggestion to use function textDidChange() to perform code inside this function automatically. It is working. It is in my Controller class.

Now I am going to use this approach for creating automatically, inside of textDidChange(), a dictionary variable from text, when user is typing in NSTextView. Then, I need this dictionary for the NSTableView functions, to display a Table in application corresponding to the text typed by user. Question is how to make accessible this dictionary from textDidChange(_:) function for the NSTableView functions like

numberOfRowsInTableView(tableView: NSTableView)

and

tableView(tableView: NSTableView, viewForTableColumn tableColumn: NSTableColumn?, row: Int) -> NSView?

All in the same Controller class.

1

1 Answers

1
votes

I am not sure if same dictionary will be your datasource for the tabelview .But for this method you can simply call reloaddata function of tableview to after updating your tableview datasource .