简体   繁体   English

Xcode,Swift,表格视图控制器

[英]Xcode , Swift , Table View Controller

我已经在情节提要上启动了一个Table View Controller和Designed Static Custom Cells,所以当我创建一个新的自定义swift文件(table view controller类)并添加到table view controller时,部署应用程序时,表部分消失了。

It seems that your problem is these delegates. 看来您的问题是这些代表。 They are provided in the template, and these will remove any static cells in this state. 它们是在模板中提供的,它们将在此状态下删除所有静态单元格。 So if you are just using static cells, remove these functions, otherwise modify them to work with dynamic cells as well. 因此,如果您仅使用静态单元格,请删除这些功能,否则请修改它们以使其与动态单元格一起使用。

// MARK: - Table view data source

override func numberOfSections(in tableView: UITableView) -> Int {
    // #warning Incomplete implementation, return the number of sections
    return 0
}

override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    // #warning Incomplete implementation, return the number of rows
    return 0
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM