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