-1

How do I change this to a String so I can see it in the laps cell field?

let query = PFQuery(className:"Participant")
   query.whereKey("school", equalTo:userSchool)
    query.findObjectsInBackgroundWithBlock({ (objects, error) -> Void in

        if let objects = objects {
            for object in objects {
                self.participantId.append(object.objectId! as String)
                self.firstname.append(object["firstname"] as! String)
                self.lastname.append(object["lastname"] as! String)
                self.laps.append(object["laps"] as! NSInteger)

}

So how do I take: self.laps.append(object["laps"] as! NSInteger) from above and turn that into a string to put in a cell label like below.

cell.lapLabel.tag = self.laps[indexPath.row] as NSInteger!;

I've seen the:

let myInteger = 5
let myString = "\(myInteger)"

But I'm confused on how to apply that to the above.

Mogsdad
  • 40,814
  • 19
  • 140
  • 246
Hoffies5
  • 25
  • 5

1 Answers1

1

I'm not really sure what you are asking. If you want to put an integer into a string, you can do it like this:

let myInteger = 5
let myString = "\(myInteger)"
dasdom
  • 13,539
  • 2
  • 41
  • 53