如何使 PFQueryTableView 在 UIViewController 中工作 [英] How to make a PFQueryTableView work inside a UIViewController

查看:44
本文介绍了如何使 PFQueryTableView 在 UIViewController 中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图弄清楚如何获得 PFQueryTableViewController 的好处,以便在嵌入了 TableView 的常规 UIViewController 中工作.因为显然我无法将解析中的数据加载到我的 TableView 上.它只是作为一个空白的 tableView 弹出,其中没有来自 Parse 的任何信息,除非代码在 UITableViewController 上运行,否则它没有问题.但我试图让我的程序在 UIViewController 中的表视图上运行.每当我将@Interface from- @interface MainWall: UIViewController 更改为@interface MainWall :PFQueryTableViewController 时,应用程序就会崩溃.

所以我的问题是,这有什么办法吗?我读了一些关于子类、子视图和容器视图控制器的内容,但除了 Parse 的 AnyWall 代码之外,没有人真正展示过如何创建它们,这非常令人困惑.

解决方案

您说得对,您必须使用容器视图控制器.这里有一个很好的容器视图教程链接

I'm trying to figure out how to get the benefits of the PFQueryTableViewController to work inside of a a regular UIViewController that has a TableView embedded in it. Because apparently I can't load data from parse onto my TableView. It just pops up as a blank tableView with none of my information from Parse in it unless the code is ran on a UITableViewController, then it has no problems. But I'm trying to get my program to run on a Table View thats in a UIViewController. And whenever I change the @Interface from- @interface MainWall: UIViewController to @interface MainWall :PFQueryTableViewController, the app crashes.

So my question is, is there anyway around this? I read a little about subclass, subviews and Container View Controller but no one actually showed how to create them besides Parse's AnyWall code, which was extremely confusing.

解决方案

You are correct in that you will have to use a container view controller. Here is a good link with a container view tutorial

这篇关于如何使 PFQueryTableView 在 UIViewController 中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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