【发布时间】:2014-06-06 22:48:30
【问题描述】:
为什么我不能改变隐式展开的可选变量?
这是一个重现问题的简短示例:
带数组
var list: [Int]! = [1]
list.append(10) // Error here
Immutable value of type '[Int]' only has mutating members named 'append'
Int
var number: Int! = 1
number = 2
number = 2 + number
number += 2 // Error here
Could not find an overload for '+=' that accepts the supplied arguments
【问题讨论】:
标签: swift