ios - Swift: Problems printing out UILabel.text -
so have routine sets different text uilabel.text values
self.addresslabel.text = firstobject["address"] as? string self.phonelabel.text = firstobject["phonenums"] as? string self.latitude.text = firstobject["lat"] as? string self.longitude.text = firstobject["lon"] as? string
but when try print out
println("\(latitude.text!)")
it outputs:
label
how can make println statement prints string "38.1848392". thanks!
you can set string variable, , print that.
so:
var latitudestring : string = self.latitude.text println(latitudestring)
edit:
seems casting latitude string not happening. following:
var lat : float = firstobject["lat"] as! float var latstring = string(lat) self.latitude.text = latstring println(latstring)
Comments
Post a Comment