这是我的代码:
var pictureVersion = snapshotValuesOnline?["PictureVersion"] as! String
print("downloaded: \(pictureVersion)")
var pictureVersionInt = Int(pictureVersion)!
print("toInt : \(pictureVersionInt)")
var pictureInt = pictureVersionInt += 1
print("plusOne : \(pictureInt)")
var pictureIntToString = "\(pictureInt)"
print("toString : \(pictureIntToString)")
这是我的输出:
downloaded: 3
toInt : 3
plusOne : ()
toString : ()
我在这里做错了什么?
答案 0 :(得分:1)
FindChildElements
被定义为一个函数,如下所示:
+=
此函数不返回任何内容,因此它等同于返回func +=(lhs: inout Int, hrs: Int) { lhs = lhs + hrs }
(定义为空元组,Void
),a.k.a。没有。
您将获得与以下相同的行为:
()