Ich versuche, eine ENUM zu protokollieren:Logging ein Swift Enum mit NSLog
enum CKAccountStatus : Int {
case CouldNotDetermine
case Available
case Restricted
case NoAccount
}
NSLog("%i", CKAccountStatus.Available)
Der Compiler beschwert sich:
Type 'CKAccountStatus' does not conform to protocol 'CVarArg'
Warum? Ich habe versucht, den Wert zu werfen:
NSLog("%i", CKAccountStatus.Available as Int)
Aber das Fliegen auch nicht:
Cannot convert the expression's type '()' to type 'String'
haben Sie 'println' versucht? – Firo
Ich tat, es druckt '(Enum-Wert)'. Richtig, aber nicht sehr hilfreich :) – zoul