0
,爲什麼這個代碼產生錯誤:url.appendPathComponent產生一個errorCannot使用變異不可變值成員:函數調用返回斯威夫特
URL(string:"string a」)!.appendPathComponent(「string b」)
錯誤:'Cannot use mutating member on immutable value: function call returns'
而此代碼的工作:
var url: URL=URL(string: "string a")! url.appendPathComponent(「string b")