When implementing an ObcJ protocol, how can you wo...
# ios
p
When implementing an ObcJ protocol, how can you work around conflicting overloads? For example, implementing
Copy code
override fun locationManager(manager: CLLocationManager, didEnterRegion: CLRegion) 
override fun locationManager(manager: CLLocationManager, didExitRegion: CLRegion)
override fun locationManager(manager: CLLocationManager, didStartMonitoringForRegion: CLRegion)
r
I would also like to know this. I don’t need it yet, and hopefully I never need it because I don’t think it’s possible at all right now
t
Add
@Suppress("CONFLICTING_OVERLOADS")
to your class and it will work. It should be documented somewhere as well.
p
Perfect, thanks - I skimmed that a few days ago when starting out, but I obviously missed that.
r
You can suppress errors? Nice
l
You can also make the suppress string literal lowercase.
r
I have follow up questions: how do I suppress this error and how do I know what the “code” is for errors to suppress them?
t
I am not sure about your error. I haven't run into this situation yet.
p
Have you tried adding an empty implementation for the referenced method (that returns
Boolean
) and suppressing the conflicting overloads?
r
The IDE never suggests to suppress errors, only warnings, I’m asking for the way to know what to suppress (the error identifier)
Like in this example, how to I know the code is
CONFLICTING_OVERLOADS
? Is there a list somewhere?
I still don’t know how to suppress “return type is not a subtype...” I can’t find the identifier