Sto cercando di registrare un enum:Logging un enum Swift utilizzando NSLog
enum CKAccountStatus : Int {
case CouldNotDetermine
case Available
case Restricted
case NoAccount
}
NSLog("%i", CKAccountStatus.Available)
Il compilatore si lamenta:
Type 'CKAccountStatus' does not conform to protocol 'CVarArg'
Perché? Ho cercato di cast del valore:
NSLog("%i", CKAccountStatus.Available as Int)
Ma che non vola neanche:
Cannot convert the expression's type '()' to type 'String'
hai provato 'println'? – Firo
Sì, stampa '(Valore enumerato)'. Corretto, ma non molto utile :) – zoul