So I created a subclass of UITableViewController and have the xib,h,m files for this controller. but when I add a UIView or a UITableViewController to my main.storyboard it will not let me set my new subclass as the custom class.
Ive been trying to get this working for about 3 days now, watching youtube videos, reading tutorials and I can't seem to find anything similar to what Im trying to do.
Im trying to create a table with header and search bar that has everything self contained, including datasets.
Make sure your class is a subclass of UITableViewController When you set it as the custom class of an UITableViewController object in the storyboard.
1: MySubClassOfTableViewController is a subclass of UITableViewController
2: Find the UITableViewController object in the storyboard
3: Set Custom Class of the UITableViewController object to MySubClassOfTableViewController
Related
I'm developing a custom class.
The goal is user will add a UITableViewController to the storyboard and set its class to mine.
and my class will fill the tableView.
Here's my question: I want to give the user to set some attributes like header color, etc in storyboard, but #IBdesignable can't be used for UITableViewController
Any idea?
I think the easiest solution is to subclass a UITableView instead of UITableViewController.
I am writing a simple app with custom storyboards for iPhone and iPad. I have a generic viewcontroller class from which my custom iPhone and iPad viewcontrollers inherit. Outlets and IBActions in my storyboards are mostly wired up to the generic viewController class and everything works well.
Now for stylistic reasons I decided to make my iPhone's viewcontroller be a UITableViewController and it can no longer inherit from my generic viewcontroller. I've been googling and searching this site and see advice which says I should write a category and use this in my custom classes.
I have never done this, but I looked at the documentation and understand the concept, but once I move my code into a category, how would I be able to link my storyboard's outlets and actions (ctrl-drag from storyboard) to the methods which are now moved out of my custom viewcontroller classes? Usually I would for example ctrl-drag from a switch in the storyboard to an existing IBAction method in my generic viewController, but these methods will now be inherited and not showing my my custom classes to drag to.
I am just a hobbyist and newb, so I apologize if this question is too basic.
You can use UIViewController with UITableView instead of UITableViewController.
1.In storyboard, get a new UIViewController and linking with your custom viewcontroller class.After that,put an UITableView into that UIViewController and linking with that class using (ctrl-drag from storyboard) called mTableView
2.In that class you should implement <UITabBarControllerDelegate,UITableViewDataSource>.
Use mTableView instead of self.tableView just like in UITableViewController.
I need to create a UIViewController which has a UITableView inside it. I found some similar questions on here but I want to use a separate class a my data source and delegate, a class that will subclass PFQueryTableViewController from Parse SDK.
So in my storyboard I have one UIViewController with one UITableView on it.
I also have a class called ArticleTableViewController (inherits from PFQueryTableViewController). I would like this class to be the delegate and the datasource for my table view, but I donĀ“t know how to connect them correctly.
Any ideas?
I tried to do something like this, i've got the answer: you can't use the PFQuaryTableViewController as a subclass of a UIViewController.
Here's my original question with the answer and some useful suggestions.
I'm attempting to create an application for iOS, using Xamarin and storyboards. Within this, there shall be a button located in a TableViewController which will navigate the user.
To do this, I've used a Container, embedded to a TableViewController. However, my concern is I wish to add an Outlet from the button within the TableViewController to the ViewController header class - Yet it only allows me to try and add one to the 'UITableViewController.h' file.
What is causing this and how am I able to add the Outlet to the 'ViewController.h' file? (Extremely sorry if this makes little sense)
You should not use both the UITableViewController and the UIViewController. UITableViewController is a subclass of UITableViewController so all you need the UITableViewController and you should drag the outlet to it.
I am trying to create a Navigation based application where the rootviewcontroller has a uitableview in it. I would like to change this so its just a standard uiview however everything I have tried so far keeps giving me errors.
First of all you create navigation based application and then delete TableView from rootViewController.xib and take it view from library and connect it and more thing is that to insert uiviewcontroller instead of uitableview in rootviewcontoller.h file and build & run your project its work fine.
How can I add both table view and a uiview to that view?
Follow this steps:
1) Go to the .XIB and remove the UITableView from the root.
2) Add an UIView and put an UITableView inside of it.
3) Change the type of controller from UITableViewController to UIViewController ( you can change this on the 3rd tab):
4) Go to your class and change his parent from UITableViewController to UIViewController.
5) Add the UITableViewDataSource and the UITableViewDelegate protocols.
6) Connect your UITableView data source and delegate to your class from the .XIB