First off, I am completely new to iOS development, so I hope there is an easier way to do things.
I am using iOS 5 storyboarding to create a dynamically generated question view. I am trying to embed a UITableViewController inside of a UIViewController so I can define different types of questions but use the same basic template. The code works, but when I try to select a cell didSelectRowAtIndexPath is never fired. I have checked the datasource and the delegate and they are both set to the correct controller. My code for the embed is:
CGRect questionViewRect = self.QuestionContentView.bounds;
UIViewController<QuestionViewProtocol>* questionView = [[UIStoryboard storyboardWithName:@"MainStoryboard" bundle:NULL] instantiateViewControllerWithIdentifier:@"MultipleChoiceQuestion"];
[questionView.view setFrame:questionViewRect];
[self.QuestionContentView addSubview:questionView.view];
Again I am doing this because I really like the storyboard, but I want to dynamically change that table view to something else for different kinds of questions. Thanks for any help!
Here is a screenshot of my storyboard. I am embedding the view from the controller on the right into a subview of the controller on the left.

So I got it figured out. The problem was that the controller for my subview was being instantiated in a method and assigned to a LOCAL variable. This means that it wasn’t being retained, so when the table view tried to access it later all it got was a nil pointer. In objective-c, methods for nil pointers just return nil so the program didn’t crash. After I added a strong pointer to the main controller class and set that controller to the instantiated sub-controller it worked perfectly.