Xcode 6.1 Attributwörterbücher in Swift
Nach dem Upgrade von Xcode 6 Beta 7 auf Xcode 6.1 Beta 2 funktioniert Folgendes nicht mehr:
let font = UIFont(name: "Arial", size: 16)
let colour = UIColor.redColor()
let attributes = [NSFontAttributeName: font, NSForegroundColorAttributeName: colour]
ch habe versucht, das Wörterbuch ausdrücklich als @ zu deklariere
let attributes: [NSString : AnyObject] = [NSFontAttributeName: font, NSForegroundColorAttributeName: colour]
aber ich erhalte die Fehlermeldung "Kann ... 'Dictionary' nicht in 'NSString!' konvertieren". Den Schlüssel als @ deklarierNSString!
eher, alsNSString
beschwert sich, dassNSString!
ist nicht hashbar. Irgendwelche Hinweise