Post

Replies

Boosts

Views

Activity

How do I insert into Source List
I am using a Source List to display my data, here is my connection code @IBOutlet weak var listbox: NSOutlineView!, when inserting into it, it looks like nothing changed until you click the on the very top of the Source List then you select something, here is my data source: class MyDataSource: NSObject, NSOutlineViewDataSource {     var items: [[String: String]] = []          func outlineView(_ outlineView: NSOutlineView, numberOfChildrenOfItem item: Any?) -> Int {         return items.count     }          func outlineView(_ outlineView: NSOutlineView, child index: Int, ofItem item: Any?) -> Any {         return items[index]     }          func outlineView(_ outlineView: NSOutlineView, isItemExpandable item: Any) -> Bool {         return false     }          func outlineView(_ outlineView: NSOutlineView, viewFor tableColumn: NSTableColumn?, item: Any) -> NSView? {         let cell = outlineView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "MyCell"), owner: self) as! NSTableCellView         cell.textField?.stringValue = item as? String ?? "error"         return cell     } } I am using Xcode 10.1, Can anyone help?
2
0
331
Jan ’23