zl程序教程

您现在的位置是:首页 >  其它

当前栏目

cannot assign to 'self' outside of a method in the init family

to in The of &# 39 Cannot method
2023-09-27 14:22:41 时间

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

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