が動作していない: https://www.raywenderlich.com/78568/create-slide-out-navigation-panel-swiftカスタムXIBセルは、私は次のチュートリアル使用XIBファイルでメニューアウトスライドを作成してい
を今、私はカスタムとXIBのテーブルビュービューを作成する時点でねテーブルビューセル。 stackoverflowの上のいくつかの質問を読んで、私は次のコード
override func viewDidLoad() {
super.viewDidLoad()
var nib = UINib(nibName: "MenuCell", bundle: nil)
tableView.registerNib(nib, forCellReuseIdentifier: "menucell")
tableView.reloadData()
print("count: \(animals.count)")
}
と実際のセル
extension SidePanelViewController: UITableViewDataSource {
func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 1
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return animals.count
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell:MenuTableViewCell = self.tableView.dequeueReusableCellWithIdentifier("menucell", forIndexPath: indexPath) as! MenuTableViewCell
cell.configureCell(animals[indexPath.row])
return cell
}
に来たしかし、テーブルビューは、タイトルのカスタムテーブルビューのセルを示していません。誰もこの問題で私を助けることができますか?
バンドル内のxibの名前は何ですか?それは "MenuCell"です –
はい、MenuCell.xib – KNV
と属性インスペクタウィンドウで識別子として "menucell"と言いましたか? –