I have a database setup on Parse.com, and one of the column has a type Number. When I pull the data from Parse, I'm given the error that I can't convert __NSCFNumber to Int32.
var index = word["index"] as! Int32
I can't seem to find any solution anywhere, could someone tell me what would be the correct way to convert __NSCFNumber type to Int32?
Thanks!
__NSCFNumber is a subclass NSNumber. To get an integer out of an NSNumber, you would use its integerValue property:
var index: Int32 = word["index"].integerValue
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With