【发布时间】:2015-02-05 04:08:42
【问题描述】:
无论我走哪条路,我都遇到了 NSAtributedString 的问题,而且似乎无法弄清楚问题是什么。
使用下面的代码,我得到:Cannot invoke 'init' with an argument list of type '(string: StringLiteralConvertible, attributes: $T6)'
let cancelButtonTitle = NSAttributedString(string: "CANCEL", attributes: [NSFontAttributeName: buttonFont, NSForegroundColorAttributeName: UIColor.whiteColor()])
有什么想法吗?我在 xcode 6.1 和 6.2 中尝试过。
【问题讨论】:
-
能否请您显示定义 buttonFont 变量的行?
-
看看如何使用 NSAttributedString stackoverflow.com/questions/27728466/…
标签: ios iphone swift xcode6 nsattributedstring