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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:34:44+00:00 2026-06-04T15:34:44+00:00

I have ViewController and then two different ViewControllers that extend that main ViewController ,

  • 0

I have ViewController and then two different ViewControllers that extend that main ViewController, one for the iPhone and the other for the iPad.

The iPad’s ViewController instantiates a separate extended UIView and sets it as its own view. That view has some buttons, which I want to add its selector methods as some methods in the main ViewController. How can this be achieved?

So here’s a way to visualize this:

Main ViewController
| iPhone ViewController
| iPad ViewController
  | Some UIView Class    --> Button must invoke method in Main View Controller

EDIT:
I do not use interface builder at all.

  • 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-06-04T15:34:46+00:00Added an answer on June 4, 2026 at 3:34 pm

    Unless I’m misunderstanding the question, there’s no trick to it.

    If you define (IBAction)buttonPressed:(id)sender in the main view controller, it’s inherited by the iPad view controller subclass. Therefore specifying it as a selector belonging to self when the iPad view controller sets up its button should work fine.

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

Sidebar

Related Questions

I have an app that has two viewcontrollers Viewcontroller and OptionsViewController. Viewcontroller is the
Hey all, Here's a funny one. I have two ViewControllers: first one (fires on
I am trying to remove two viewcontrollers (that have been added on top of
I am trying to remove two viewcontrollers (that have been added on top of
For example I have a ViewController named firstViewController. Then I would like to call
I have UINavigationController and UIViewController, then I push another viewcontroller, but I don't need
I have a ViewController that has its own NIB. I would like to embed
I have a viewController that autorotates just fine, The problem is that is I
i have more viewcontroller that start from rootviewcontroller. So for example i start with
I have an opengl game for iPhone/iPad (universal). I added the ability to send

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.