When I try to do the line below, I dont get a warning (not an error). What is this am I am doing something bad?
I am trying to cast the integer earningsSoFar
to a NSNumber because I want to get the .stringValue
out of it.
I want to understand what is the warning mean here and how to do this right.
self.tv_salaryNumber.text = (earningsSoFar as! NSNumber).stringValue
You can cast
Int
toNSNumber
in this waySo,in your code,just try
Also,as zeneak said,you can make it easier in his way