По какой-то причине названия моих ячеек дублируют. Вот код:TableView делает несколько копий одной и той же метки, swift
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! ContactsTableViewCell
// Configure the cell...
cell.contactNumberLabel.text = allNumbers[indexPath.row]
// App downloads confirmedContactList from server
// Before data is downloaded confirmedContactList is empty and 'for in' loop crashes app.
if confirmedContactList != new {
// Title should appear only in cells where arrays allNumbers and confirmedContactList are identical
for n in 0..<self.allNumbers.count {
for k in 0..<self.confirmedContactList.count {
if self.allNumbers[n] == self.confirmedContactList[k]{
cell.nameLabel.text = "This Title Keeps Duplicating"
}
}
}
}
return cell
}
В принципе, есть два массива, содержащие телефонные номера, если контактный номер отображается в ячейке существует в confirmedContactList
тогда cell.nameLabel
должен сказать что-то конкретное.