Silence some -Wselector warnings using pragmas.

The compiler is wrong in all these cases.
Silence warnings about ambiguous selectors.

This reworks the method to use explicit casting so that it doesn't
need to make untyped sends to delegate and setDelegate.