I am not able to assign a textField with the result of a search when it is int, with String sure
var results:NSArray = try context.executeFetchRequest(request) as! [NSManagedObject]
if(results.count > 0){
var res = results[0] as! NSManagedObject
nomeText.text = res.valueForKey("nome") as? String
idadeText.text = res.valueForKey("idade") as? String
print(res.valueForKey("idade") as? String)
}
In print it returns me nil .. when it changes to Int, it returns me correct value .. how do I assign the textField to this value, remembering that with the name field I do not have this error