
October 6th, 2010, 09:56 AM
|
|
Registered User
|
|
Join Date: Sep 2010
Posts: 6
Time spent in forums: 1 h 22 m 24 sec
Reputation Power: 0
|
|
Here is the full block of code that I got to work:
Code:
DetailViewControllerSenateNoTossUp *controller = [[DetailViewControllerSenateNoTossUp alloc] initWithNibName:@"DetailView" bundle:nil];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller];
navController.view.frame = CGRectMake(0, 0, 320, 416);
[controller release];
CGRect frame;
frame.origin.x = 0;
frame.origin.y = 100;
frame.size.height = 200;
frame.size.width = 280;
UIView *try = [[UIView alloc] init];
try = controller.tableView;
try.frame = frame;
[self.tableView addSubview:try];
self.tableView = controller.tableView;
self.tableView.delegate = self;
The most important part of this is the last three lines. It must also be in that order. 1) Add the new table view to your current view. 2) Set the current table view to equal the new table view. 3) Set the current table as the delegate.
Code:
[self.tableView addSubview:try];
self.tableView = controller.tableView;
self.tableView.delegate = self;
|