Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7025215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:56:41+00:00 2026-05-27T23:56:41+00:00

First off, I am completely new to iOS development, so I hope there is

  • 0

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.

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:56:42+00:00Added an answer on May 27, 2026 at 11:56 pm

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off, I'm completely new to Drupal, so I could be making a ridiculously
First off, I'm a complete beginner at C++. I'm coding something using an API,
First off, I am using Windows XP. I have multiple hard drives and it
First off, there's a bit of background to this issue available on my blog:
First off: I'm using a rather obscure implementation of javascript embedded as a scripting
First off I'm new at programming. I'm creating an app with one navigation bar
Let me start off by saying that I am completely new with WPF (this
First off I'm new to owning an android and trying to develop android apps.
So I'll start off by saying I'm completely new to JS and JSQuery. So
First off, I apologize if this is a confusing or backwards way to go

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.