Я пытаюсь разобрать с помощью дополнительного значения, которое имеет эти значения в немUnwrapping факультативное значение
Optional(UITableViewCell: ox7ff2f9cfbc80; frame = (0 0; 414 44); text = 'Clarity'; autoresize = W; layer = <CALayer:0x7ff2f9cfb250>>)
и хотел бы просто захватить текстовую часть «Ясность», чтобы распечатать в другой строке. Пожалуйста, дайте мне знать, если это возможно, поскольку я новичок в Swift! Благодаря!
Вот как я создал ячеек таблицы
У меня есть список Песни Треки здесь
tracks = [Clarity, Freak-a-Leek, What's My Age Again?, All The Small Things, Bandz A Make Her Dance, Cant Tell Me Nothing, Slow Jamz, Hate It Or Love It, Dark Horse, Teenage Dream, In Too Deep, Just Hold On, We're Going Home, Energy, Fat Lip]
и создать tableviewcells, выполнив следующие действия
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{
var cell = tableView.dequeueReusableCellWithIdentifier("cell") as? UITableViewCell
cell?.textLabel?.text=self.tracks[indexPath.row]
return cell!
}
и вот как Я получаю дополнительное значение
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath!) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
println("You selected cell #\(indexPath.row)!")
let Cell = tableView.cellForRowAtIndexPath(indexPath)
}
Покажите нам код, как вы устанавливаете свою ячейку. – Christian
Обновлено. Извинения за ожидание. –