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

The Archive Base Latest Questions

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

I need to call a method in the viewcontroller that creates a popupviewcontroller, from

  • 0

I need to call a method in the viewcontroller that creates a popupviewcontroller, from the created popupviewcontroller.

For iPad I create it like this:

if (!self.flipsidePopoverController) {
    FlipsideViewController *controller = [[[FlipsideViewController alloc] initWithNibName:@"FlipsideViewController" bundle:nil] autorelease];
    controller.delegate = self;
    self.flipsidePopoverController = [[[UIPopoverController alloc] initWithContentViewController:controller] autorelease];
}
if ([self.flipsidePopoverController isPopoverVisible]) {
    [self.flipsidePopoverController dismissPopoverAnimated:YES];
}
else
{
    /// The important part ///
    [self.flipsidePopoverController presentPopoverFromRect:CGRectMake((self.view.frame.size.width-320), 0, (self.view.frame.size.width), 10) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
}

Now I wish to call a method in my main view controller from within the popup. How can I achieve that?


My iPhone equivalent is this:

// Creating it //
FlipsideViewController *controller = [[[FlipsideViewController alloc] initWithNibName:@"FlipsideViewController" bundle:nil] autorelease];
controller.delegate = self;
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:controller animated:YES];

Calling a method from within the popup:

if ([self.presentingViewController isKindOfClass:[MainViewController class]])
    [(MainViewController*)self.presentingViewController resetClock];
  • 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-27T05:22:57+00:00Added an answer on May 27, 2026 at 5:22 am

    Give the displayed view controller a reference to your main view controller. Eg:

    @class MainViewController;
    @interface FlipsideViewController : UIViewController
    {
    }
    
    @property (nonatomic, assign) MainViewController *mainController;
    
    @end
    

    (Don’t forget the @synthesize in the implementation!)
    Later when you present the popover, just set the property:

    [controller setMainController:self];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to call a method that accepts a stream argument. The method loads
This is hopefully a softball syntax question: I need to call a method with
I need a help from ur side. Actually I need to call a method
I am creating a Console Application, in that I need to Call a Method,
Basically, I need to call a method in my AppDelegate from one of my
I can call partial method from a view object. However, I need to call
I am trying to call a method that returns an object and need help
I need to call a method I have defined as: -(IBAction)next:(id)sender{ ... } I
I have a use case where I need to call a (non-static) method in
In Microsoft IL, to call a method on a value type you need an

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.