ios - PFQueryTableView 未显示 - 在 SWIFT 中使用 PARSE

标签 ios swift parse-platform

我已经把它添加到我的 appdelegate 中了

var controller:PFQueryTableViewController = PFQueryTableViewController(className: "Types_")
self.window?.rootViewController = controller
println(self.window?.rootViewController)

我像这样在 swift 中创建了一个新类:

class TableViewController: PFQueryTableViewController {

    override init!(style: UITableViewStyle, className: String!) {
        super.init(style: style, className: className)
    }


    required init(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)

        self.parseClassName = "Types_"
        self.pullToRefreshEnabled = true
        self.paginationEnabled = true
        self.objectsPerPage = 5
        //self.textKey = "TypeOfVenue_"
}
    override func queryForTable() -> PFQuery! {

        var query = PFQuery(className: self.parseClassName)

        if (objects.count == 0)
        {
            query.cachePolicy = kPFCachePolicyNetworkOnly
        }

        return query


    }


    override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!, object: PFObject!) -> PFTableViewCell!

   {

    var cellIdentifier = "eventCell"
    var cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier) as PFTableViewCell!
    if cell == nil {

        cell = PFTableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: cellIdentifier)

    }
    cell.textLabel?.text = object["TypeOfVenue_"] as NSString
    cell.detailTextLabel?.text = object["Seating"] as NSString
    return cell



   }

但是新类不执行,如果我在类中加断点,它不执行断点。

我在 Storyboard 中添加了一个 ViewController,并将该类链接到 View Controller ,如下所示:

enter image description here

有人有什么想法吗?

最佳答案

我在 Storyboard 上创建了一个 TableView Controller ,并删除了应用程序委托(delegate)中的代码以创建该 Controller 。

然后我将这个类添加为 TableView Controller 上的类,它起作用了。

关于ios - PFQueryTableView 未显示 - 在 SWIFT 中使用 PARSE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27508737/

相关文章:

ios - ipad retina 显示 webkit 动画性能差

swift - 获取 PFUser 引用对象

ios - 查询当前用户信息

ios - 多种类型的 segue 仍然无法移动 View Controller

java - 如何使用 ParseQuery 对同一数据库列进行 OR 查询?

ios - In-House Enterprise Distribution : iOS 7 device "Unable to Download App", iOS 8 设备没有问题

iphone - 用于模糊的 OpenGL ES 2.0 片段着色器速度慢且质量低

ios - 通过 Curl 的 App Store 停止工作

ios - 升级到 Xcode-beta 7 后出现奇怪的编译错误

ios - CollectionView 嵌套在 Collectionview 中