我遷移代碼的XCode 6.4〜7,似乎這個錯誤不會分辨。不能調用類型NSAttributedString初始化與類型的參數列表(字符串:字符串,屬性:[NSObject的:AnyObject]?)
func onHoldReasonAttributedTextSetup(onHoldReson : String) -> NSMutableAttributedString
{
let markerFontAttributes : [NSObject : AnyObject]? = [
NSFontAttributeName : UIFont(name: "HelveticaNeue", size: 12.0)!,
NSForegroundColorAttributeName : UIColor(red: 0/255, green: 152/255, blue: 204/255, alpha: 1.0)
]
let onHoldText = NSAttributedString(string: "On Hold: ", attributes: markerFontAttributes)
let onHoldReasonText = NSAttributedString(string:onHoldReson)
var string = NSMutableAttributedString()
string.appendAttributedString(onHoldText)
string.appendAttributedString(onHoldReasonText)
return string
}
使用像'讓markerFontAttributes = [ NSFontAttributeName:UIFont(名: 「HelveticaNeue」,大小:12.0)! NSForegroundColorAttributeName:的UIColor(紅色:0/255,綠色:255分之152,藍色:二百五十五分之二百○四,α-:1.0) ]' –