Swift - Extra Argument in call

前端 未结 6 1959
梦毁少年i
梦毁少年i 2020-11-30 09:40

I am trying to call a function declared in ViewController class from DetailViewController class.

When trying to debug the \'Extra Argument in call\" error pops up.<

6条回答
  •  爱一瞬间的悲伤
    2020-11-30 10:12

    This error will ensue, if there is a conflict between a class/struct method, and a global method with same name but different arguments. For instance, the following code will generate this error:

    enter image description here

    You might want to check if there is such conflict for your setCity method.

提交回复
热议问题