[swift-users] disambiguate selector

J.E. Schotsman jeschot at xs4all.nl
Fri Jan 13 14:16:10 CST 2017


When I wrote this:

table.performSelector( onMainThread:#selector(NSTableView.reloadData) )

I got a message “Ambiguous reference to member 'reloadData()”

With a little help from Stackoverflow I managed to fix it:

#selector(NSTableView.reloadData as (NSTableView) -> ((Void)->Void)))

My question is: why can’t I just write


as opposed to


Jan E.

BTW the use of “onMainThread" as a label for a selector appears a bit strange to me.

More information about the swift-users mailing list