Just started migration to Swift 4 under Xcode 9. All fine so far, except that I have a MAC OS app with a NSTableView in which I can only set the row background colours if I have the objc inference set ON.
I am setting the row colour during
tableView(_ tableView: NSTableView, didAdd rowView: NSTableRowView, forRow row: Int)
Worked Swift 3, works in Swift 4 with objc inference set on, is silently ignored with inference default.
To be clear, I have created a trivial new table view MAC OS app using Xcode 9 + swift 4 and the same code organisation works as expected. So I am guessing that it is something happening with project migration.
I have tried @objcmembers for all my classes in the app hoping to identify the problem area with no success. I am assuming that objcmember'ing all my classes would be equivalent to setting the objc inference build ON, but it seems not.
One bit of debugging shows me that, in the trivial new app with the inference as Default OR when I have objC inference to ON in my app, when didAdd is called, the rows have a background colour set to "NSNamedColorSpace System controlBackgroundColor" whilst when I set the objc inference to Default for my app, the row background colour is "nil".
To me this suggests that my didAdd delegate function is getting called at different times somehow. It looks as though, for me, with inference set to default in my app, my didAdd delegate is getting called before some system level equivalent (which is then overwriting my setting of the row colour) whilst having inference ON is calling the system function first and then my delegate.
So has anyone experienced anything like this or have suggestions as how to try tracking down what I have doing wrong ?
Alan.
(Release Xcode 9/swift 4 - no beta used, MAC OS Sierra 10.12.6)