2015-11-13 54 views
-1

如何将其更改为字符串以便我可以在圈单元格字段中看到它?Swift TableView单元格:如何将整数更改为字符串

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) 

}

那么,如何采取:self.laps.append(object["laps"] as! NSInteger)从上面并把它转换成字符串放在一个细胞标签像下面。

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

我见过的:

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

但我对如何应用上述困惑。

回答

0

我不确定你在问什么。如果你想把一个整数转换成一个字符串,你可以这样做:

let myInteger = 5 
let myString = "\(myInteger)" 
相关问题