Ios 快速解析查询表
我想通过PFQueryTableView和Cell从解析中导入一些数据。我在故事板上配置了一个tableview,并使用PFQueryTableViewController和PFQueryTableViewCell分配tableview及其单元格。因此,在我的tableview控制器上,我使用下面的代码,但它在super.init(className:myClassName)行上给了我一个错误,并显示一条消息“必须调用超类“PFQueryTableViewController”的指定初始值设定项”Ios 快速解析查询表,ios,swift,parse-platform,Ios,Swift,Parse Platform,我想通过PFQueryTableView和Cell从解析中导入一些数据。我在故事板上配置了一个tableview,并使用PFQueryTableViewController和PFQueryTableViewCell分配tableview及其单元格。因此,在我的tableview控制器上,我使用下面的代码,但它在super.init(className:myClassName)行上给了我一个错误,并显示一条消息“必须调用超类“PFQueryTableViewController”的指定初始值设定项
你必须换新的
super.init(className: myClassName)
到
我检查了PFQueryTableViewController类的实现,我认为这是因为与桥接Swift到Objective-C有关的某种缺陷。它与Swift中指定的初始值设定项有关。因为上面的init方法没有设置为指定的初始值设定项,而下面的是。您必须替换
super.init(className: myClassName)
到
我检查了PFQueryTableViewController类的实现,我认为这是因为与桥接Swift到Objective-C有关的某种缺陷。它与Swift中指定的初始值设定项有关。因为上面的init方法没有设置为指定的初始值设定项,而下面的是。您需要覆盖
queryForTable
:
// Define the query that will provide the data for the table view
override func queryForTable() -> PFQuery {
var query = PFQuery(className: "myClassName")
return query
}
此外,在self.parseClassName=mycloumnname
上,应该提供类名而不是列名
此外,您还需要覆盖init
:
// Initialise the PFQueryTable tableview
override init(style: UITableViewStyle, className: String!) {
super.init(style: style, className: className)
}
您可以找到更多详细信息。您需要覆盖
queryForTable
:
// Define the query that will provide the data for the table view
override func queryForTable() -> PFQuery {
var query = PFQuery(className: "myClassName")
return query
}
此外,在self.parseClassName=mycloumnname
上,应该提供类名而不是列名
此外,您还需要覆盖init
:
// Initialise the PFQueryTable tableview
override init(style: UITableViewStyle, className: String!) {
super.init(style: style, className: className)
}
你可以找到更多的细节