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 989493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:48:06+00:00 2026-05-16T05:48:06+00:00

When you have an UIViewController and UITableViewController classes and you wanted to let these

  • 0

When you have an UIViewController and UITableViewController classes and you wanted to let these two do some common stuff in their - (void)viewDidLoad how could you achieve this in Objective-C without actually duplicating your code?

I tried to create MyUIViewController inheriting UIViewController and implement viewDidLoad in there. This perfectly works with UIViewController classes obviously, but won’t work in UITableViewController, since I can’t simply replace @interface MyTableViewController : UITableViewController with @interface MyTableViewController : MyUIViewController.

I believe this topic is about “multiple inheritance” in Objective-C language, but other than figuring out what’s different in Objective-C, I’d really like to know how to do guys do such thing?

  • 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-16T05:48:07+00:00Added an answer on May 16, 2026 at 5:48 am

    This thread has some good information. One of your main options is to make a class with that shared functionality and hold it as an instance variable, then forward messages to it in forwardInvocation.

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

Sidebar

Related Questions

I have a couple of UITableViewController classes and I just noticed that these methods
I have a UITableViewController which pushes a UIViewController and I need to pass two
In my application, I have two View Controllers - a UIViewController and UITableViewController. Now,
I have a UITableviewController and I push another UIViewController in 'didSelectRow..' method. I have
I have a uiviewcontroller with two properties: trackName and playerObject. PlayerObject also has a
I have a view controller (derived from UIViewController not UITableViewController) containing a table view.
I have a UIViewController (parentVC) to which I add a UITableViewController as follows (it
I have a UIViewController that inherits from UITableViewContoller: @interface AllProductsViewController : UITableViewController And I
I have a UITableViewController that pushes a UIViewController using a UINavigationController: [self.navigationController pushViewController:detailViewController animated:YES];
I have a UIViewController which shows different UIViewController sub-classes. In the main UIViewController.m, I

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.