Tag: 转换向下

Swift下行选项:作为? types,或作为! types?

在Swift中给出以下内容: var optionalString: String? let dict = NSDictionary() 以下两种说法有什么实际区别: optionalString = dict.objectForKey("SomeKey") as? String VS optionalString = dict.objectForKey("SomeKey") as! String?