Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 用选择器覆盖方法'***';具有不兼容的类型'****';作语法分析_Objective C_Swift_Parse Platform - Fatal编程技术网

Objective c 用选择器覆盖方法'***';具有不兼容的类型'****';作语法分析

Objective c 用选择器覆盖方法'***';具有不兼容的类型'****';作语法分析,objective-c,swift,parse-platform,Objective C,Swift,Parse Platform,我正在使用Parse。我试图查询数据库中对象的列表。我正在使用swift编程语言。我认为造成这个错误的原因是obj-c和swift桥。有人能帮我吗? 这是我的密码 override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! { 只有第一行有错误。编辑!它必须是这样的: override func tableView(t

我正在使用Parse。我试图查询数据库中对象的列表。我正在使用swift编程语言。我认为造成这个错误的原因是obj-c和swift桥。有人能帮我吗? 这是我的密码

override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! {

只有第一行有错误。

编辑!它必须是这样的:

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
出于某些代码向后兼容的原因,您可以使用和以下选项:

override func tableView(tableView: UITableView?, cellForRowAtIndexPath indexPath: NSIndexPath?) -> UITableViewCell {

只需将“!”符号改为“?”。我使用的是Xcode 6转基因种子。UITableViewDataSource中有一些更改。我得到了同样的错误,但是像这样修改它对我来说很有用…

你可以删除!在UITableView之后,NSIndexPath和UITableViewCell作为“协议UITableViewDataSource”具有以下签名:

重写func tableView(tableView:UITableView,cellForRowAtIndexPath:nsindepath)-UITableView单元格

答案对我来说太有用了