I have been going through this tutorial, "Option 2: Prototype Cells" I implimented all the steps, but, the following code gives me an error:
@interface MTViewController : UITableViewController
@end
the error message is:
instantiated view controller with identifier "UIViewController-BYZ-38-t0r" from storyboard "Main", but didn't get a UITableView.'
Here is what I tried - I changed UITableViewController
to UIViewController
and the error went away. But, the tableview remains blank. Can you tell me why this is ?
I've had this problem too. I created originally plain
UIViewController
then i decided to rather useUITableViewController
. Problem is that i forgot to set storyboard ID on new controller, and change it to something else on the old controller, otherwise you will instantiate the old controller from storyboard and this problem will occur.Actually you are using UIViewController not UITableViewController. Delete your default view controller and drag new TableViewController in your storyboard. Because your ViewController not having TableView, but it's trying to load cells.
Simple solution is : Delete ViewController and add TableViewController
Then you have to change its class name to MTViewController or Your Class Name