1
我正在嘗試使用Swift(第4章表格視圖)中的練習。上下文類型「表情符號」不能與數組文字一起使用
練習告訴我將[Emoji]
類型的屬性「emojis」添加到viewControllerClass
。代碼如下:
var emojis: [Emoji] = [
[Emoji(symbol: "", name: "Grinning Face", description: "A typical smiley face.", usage: "happiness"),
]
]
但是這行代碼引發錯誤:
Contextual type "Emoji" cannot be used with array literal.