1つのラベルと項目の追加ボタンで単純なセルを表示しようとしています。私はそれを正しく表示することができません。私は多くの時間を費やしましたが、解決策を見つけることができません。
Xcode 7.3 UITableViewControllerセルが正しく表示されない
これは結果である:
ないadd item
ボタンなし正しい行がありません。私はcoredataにちょうど2つの項目があります。
これは私のコードです:
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 1
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of rows
return items.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath)
let data = items[indexPath.row] as Item
cell.textLabel?.text = data.body
return cell
}
の問題は何ですか?誰も私がadd item
ボタンを表示し、正しい行数を表示し、セルの高さを正しくカスタマイズするのを助けることができますか?ありがとうございました。
プロトタイプのセルスタイルは何ですか? – slxl
こんにちは@slxlカスタムスタイル – Akram