2

I wanna display a name list and a button under the list, but not sure how should i do it. Is it correct to create a blank View Controller, then drag a table view with table view cell and a button to it? The button will navigate to the add names function. Or is it possible directly with a table view controller?

If i do it with blank view controllers ,i must make a class for the dragged table view and cell or i can edit them inside the class of a normal view controller? I wanna use it with Parse.com and it's PFQueryTableViewController.

This is how it looks like now:

This is how it looks now

1
  • UITableViewController is just a subclass of UIViewController which can be used for convenience. All it does is just setup a normal UIViewController with a UITableView and other things a tableView might need. If you want to add more functionality I would suggest using a UIViewController since it gives you more options and controls than the UITableViewController. Commented Apr 30, 2014 at 12:34

2 Answers 2

1

You cannot use PFQueryTableViewController as a subview in a UIViewController, but you can probably get there by using viewcontroller containment.

See this Q for some more info: How can I use PFQueryViewController as a subview of UITableViewController?

Sign up to request clarification or add additional context in comments.

7 Comments

So i should make two 'PFQueryTableViewController' classes for the two views and use viewcontroller containments for the add contact button and the search field?
If you want to use a PFQueryTableViewController to take advantage of its functionality, but also want to customize it with buttons etc, you will need to use containment. You need to read about containment. You design screen with button, search field etc, and add a container for the PFQTVC. The tutorial linked in the other answer looks fine. Or you can check this one: thinkandbuild.it/working-with-custom-container-view-controllers
I've read the two tutorials, but something is not sure. In my situation i need two 'PFQueryTableViewController' and use containments to display the add contact button and search field in the other view? Or i need only one PFQTVC which contains the add contact button and when the user pushes it, the search bar and a new table for the results will appear in the same view?
Will the two PFQTVCs display different content? If they display the same data, you can probably reuse it, but without knowing the details of your app I'm guessing you will need two. The PFQTVC does not contain the add contact button. The container view has the button, and the PFQTVC is inserted as a child view.
I will try to make something like this, but first I trying to display some basic data. I really appreciate your help, thnx.
|
0

I think you should read more about what the delegates are and do, I think they are the key concept that would solve your doubts.

Briefly, I can tell you that the delegate is basically the Class that would take responsibility on something. For example, if you are planning to have a UITableView, you should implement both UITableViewDelegate and UITableViewDataSource delegates, and the Class implementing them would take care of the data and display within that table.

So, further on, then you are planning to set up a UITableView you can do two different things:

1) Creating directly a UITableViewController, that in fact is already implementing the delegates mentioned before.

2) Create a generic UIViewController (blank as you said) and then implement those delegates and have the same functionality.

I hope this helps.

3 Comments

The OP is using (or wants to use) a PFQueryTableViewController, which is a subclass of UITableViewController, but optimized for use with Parse.com backend. He wants to customize the appearance of this, but this is not possible the way he wants it.
@Handsomeguy You could always create your custom class and implement all the protocols needed. You will need 'PF_EGORefreshTableHeaderDelegate' according to the doc (parse.com/docs/ios/api/Classes/PFQueryTableViewController.html).
Might be possible, but he specifically wants to use PFQTVC, but customized, and asks how to do that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.