在写程序时遇到这个错误,“cannot assign to 'self' outside of a method in the init family”,在网上查询后,得到了一个很奇怪的正确答案。

我一开始写的initwithCityCode,出现这个错误,在别人的回答中,竟然是把with中的小写‘w’改成大写的‘W’。改过之后一切都好了。太神奇了。

相关文章:

  • 2021-10-06
  • 2022-12-23
  • 2021-12-07
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-01
  • 2021-05-30
  • 2021-06-29
  • 2021-09-09
相关资源
相似解决方案