I have 2 views. The first one is the main UIViewController and the second is UITableViewController and it has my data to display.
So I put a button on the first one and I want to go from my UIViewController to mytableviewcontroller. But when write this code my app crashes what’s wrong in my code?
The error: thread 1 program received signal sigabrt
-(IBAction) displayTableView:(id) sender{
myTableViewController = [[MyTableViewController alloc]
initWithNibName:@"TableViewController"
bundle:nil];
[[self view] addSubview:myTableViewController.view]; // thread 1 program received signal sigabrt
}
thanks advanced
You should use property for myTableViewController, or, even better, put your controllers in UINavigationController