带有选择器的覆盖方法 '***'具有不兼容的类型 '****'解析 [英] Overriding method with selector '***' has incompatible type '****' parse

查看:72
本文介绍了带有选择器的覆盖方法 '***'具有不兼容的类型 '****'解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Parse.我正在尝试查询数据库中对象的列表.我正在使用 swift 编程语言.我认为导致此错误的原因是 obj-c 和 swift bridge.谁能帮我 ?这是我的代码.

I am using Parse. I am trying to query a list of the object in the database. I am using swift programming language. I think the reason cause this error is because obj-c and swift bridge. Can anyone help me ? Here is my code.

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

只有第一行有错误.

推荐答案

EDIT!它必须是这样的:

EDIT! It has to be like this:

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

出于某些代码向后兼容性的原因,您可以使用以下内容:

For some code backward compatibility reasons you can use and the following:

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

只需更改!"用?"符号.我正在使用 Xcode 6 GM 种子.UITableViewDataSource 有一些变化.我遇到了同样的错误,但像这样改变它对我有用......

Just change the "!" signs with "?". I'm using Xcode 6 GM seed. There are some changes in UITableViewDataSource. Iwas geting the same error, but changing it like this work for me ...

这篇关于带有选择器的覆盖方法 '***'具有不兼容的类型 '****'解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆