我正在尝试创建属性字典以传入NSString.drawInRect
。然而,斯威夫特不会让我,在神秘的错误信息'_' is not convertible to 'String'
'_'不能转换为'字符串'
let font = NSFontManager.sharedFontManager().fontWithFamily(...)
let color = NSColor.whiteColor()
let paragraphStyle = NSParagraphStyle.defaultParagraphStyle()
let attributes = [
NSParagraphStyleAttributeName: paragraphStyle,
NSFontAttributeName: font,
NSForegroundColorAttributeName: color]
下面的代码会导致什么需要怎样做呢?
马特拒绝在他的回答中举一个例子,所以这将是公认的答案,因为它符合SO标准的正确答案。谢谢。 –