disambiguate selector

Hello,

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

#selector(NSTableView.reloadData())

as opposed to

#selector(NSTableView.reloadData(forRowIndexes:columnIndexes:))

Jan E.

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

I filed a bug for this recently: [SR-3550] Compound name syntax for functions with no params · Issue #46138 · apple/swift · GitHub

Jacob

···

On Fri, Jan 13, 2017 at 12:16 PM, J.E. Schotsman via swift-users < swift-users@swift.org> wrote:

Hello,

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

selector(NSTableView.reloadData())

as opposed to

selector(NSTableView.reloadData(forRowIndexes:columnIndexes:))

Jan E.

BTW the use of “onMainThread" as a label for a selector appears a bit
strange to me.
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users