Abu Eesa Abu Eesa - 2 months ago 26
Objective-C Question

Int64 can't be converted if store in Realm

I need to save 11 digits number in Realm, for that am using

When am reading it I need to convert it's datatype to

let icnStr = employeeObj["icn"] as! String

but it is showing following error.

Could not cast value of type '__NSCFNumber' (0x186d21c) to 'NSString' (0xefd5e4).


Try String(employeeObj["icn"]), hope it help, dont downcast it but create String instance with value of the Int