美文网首页
iOS开发中variable is not assignable

iOS开发中variable is not assignable

作者: 江河_ios | 来源:发表于2018-04-18 17:19 被阅读0次

如下图所示,当我们在block代码块中使用局部变量时,就会很容易出现如图的错误: 

如上图所示

意思是:变量是不可转让的缺块。 

其实,我们只需在变量声明时加上static关键字就可以了,如图所示:

如上图所示

相关文章

网友评论

      本文标题:iOS开发中variable is not assignable

      本文链接:https://www.haomeiwen.com/subject/vucbkftx.html