Unary operator '++' cannot be applied to an operand of type '@lvalue Int'
一元运算符“++”不能应用于操作数的类型“@左值int”
需要改成"aWin+=1"
一元运算符“++”不能应用于操作数的类型“@左值int”
需要改成"aWin+=1"
2017-12-07
Cannot call value of non-function type 'UIColor'
Replace "()" with ""
Replace "()" with ""
2017-12-04
在swift4中遍历一个字符串变成了这样:
var str = "bobolaoshi dafahao"
for char in str
{
print(char);
}
var str = "bobolaoshi dafahao"
for char in str
{
print(char);
}
2017-11-25
swift 4.0 改版以后想要获取字符的最后一个直接这样写:
str[str.index(before: str.endIndex)]
str[str.index(before: str.endIndex)]
2017-11-16
新版更新后应该这么写:
str[str.index(before: str.index(startIndex, offsetBy: 5))]
str[str.index(after: str.index(startIndex, offsetBy: 4))]
str[str.index(before: str.index(startIndex, offsetBy: 5))]
str[str.index(after: str.index(startIndex, offsetBy: 4))]
2017-11-16
swift 4 更新改版以后,以下这两个spaceIndex要填什么啊?
str[str.index(before: spaceIndex)]
str[str.index(after: spaceIndex)]
str[str.index(before: spaceIndex)]
str[str.index(after: spaceIndex)]
2017-11-16