Your TextField view has probably a textField inside.
That's what you need to set textField to.
-makeViewWithIdentifier:xxxis declared like this:
- (nullable __kindof NSView *)makeViewWithIdentifier:…
This allows you to assign the result to an NSView or any NSView subclass without a warning. This isn’t imported into Swift with 100% fidelity. Instead you get this:
public func makeViewWithIdentifier(…) -> NSView?
which is only compatible with NSView itself. To fix this you have to cast the result:
let textField: NSTextField = tableView.makeViewWithIdentifier("TextField", owner: self) as! NSTextField
This will trap at runtime if the value is nil or not an NSTextField or subclass thereof, but that’s probably a good thing (-:
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"