我遇到了我的UITableView
定製單元格問題。iOS桌面視圖定製單元格出現問題
這是UITableView的代碼:
var contactName = ["Papa", "Mummy", "Ajay", "Deepak", "My"]
var phoneNumber = ["657464567", "354636346", "5436346", "6345634643", "5645634656"]
// MARK: - Table view data source
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return contactName.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! myTableViewCell
cell.name.text = contactName[indexPath.row]
return cell
}
這是我的自定義單元代碼:
@IBOutlet weak var name: UILabel!
我仔細檢查了,一切都已經正確連接,請幫我找出爲什麼我有這個問題。
您是否收到任何錯誤?如果是的話,你可以發佈該錯誤 –
錯誤不顯示只是它顯示設備或模擬器中的空表 –
您是否設置了tableview的數據源? –