【发布时间】:2015-07-18 23:39:28
【问题描述】:
我正在尝试创建一个属性字典以传递给NSString.drawInRect。但是,Swift 不会让我这样做,因为下面的代码会导致神秘的错误消息'_' 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]
需要做哪些不同的事情?
【问题讨论】: