ios - Unwrapping a Int to String cast in Swift -


i gathering nsnumber plist , want print in string:

let tijd = string(self.sortedhighscores[indexpath.row]["tijd"]!) cell.detailtextlabel?.text = "\(tijd) seconden" 

but in simulator i'm seeing printed: optional(120) seconden example. how solve this? i've tried unwrapping tijd, result in errors in compiler telling me delete !.

try this:

 var highscore : nsnumber =  self.sortedhighscores[indexpath.row]["tijd"] as! nsnumber  var : string = string(format:"%d",highscore.integervalue)  cell.detailtextlabel.text = 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -