objective c - Swift: overriding method with selector has incompatible type -



objective c - Swift: overriding method with selector has incompatible type -

i have declared class method in objective-c:

+ (id) somefunction:(nsdictionary *)param;

when subclass class , override method in swift this:

override class func somefunction(param : nsdictionary) -> anyobject?

i error:

overriding method selector 'somefunction:' has incompatible type '(nsdictionary) -> anyobject?'

how override method correctly?

when seek autocomplete class function somewhere else in swift, xcode tells me param [nsobject: anyobject]!, makes method declaration work:

override class func somefunction(param: [nsobject: anyobject]!) -> anyobject? { homecoming "foo" }

this might compiler bug, since i'm pretty sure that's supposed bridge nsdictionary! (it seems bridging 1 way, not other, or something).

objective-c swift

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -