swift4.2 dictionary problem
BrianRawlings
BrianRawlings 2018-10-14 15:53:37
0
0
1000

Help heroes: I recently watched a video to learn Swift, but when I practiced it myself, I found that the video was a little different from the actual practice. For example, when I learned arrays and dictionaries, I found the following problems:

import Foundation

//import Cocoa

//var dict:[String:String]=["name":"jack","age":"22"]

var dict=["name":"jack","age":"22"]

print(dict)

print(dict[" name"])//Warning here: Expression implicitly coerced from 'String?' to 'Any'

The output results are also different from the video, please give me some advice

BrianRawlings
BrianRawlings

reply all (0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!