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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:24:18+00:00 2026-06-07T12:24:18+00:00

I have set myself a simple challenge, which I see in many apps and

  • 0

I have set myself a simple challenge, which I see in many apps and I’m having a lot of difficulty with it.

My task is to have one ViewController with a Navigation bar, button and a label. When you press the button a UIPopover pops up with a new ViewController and the user presses a button inside that popover. When they press that button my ViewController can use that information for something. Thats it. Simple?

Therefore my parent ViewController is set up as:

UIViewController popOverViewController = new PopOverViewController ();
PopoverDelegate _popoverDelegate;  

public override void ViewDidLoad () {
    base.ViewDidLoad ();
    BarButtonItemPopover = new UIPopoverController (popOverViewController);
    BarButtonItemPopover.PopoverContentSize = new SizeF (320, 320);
    _popoverDelegate = new PopoverDelegate();
    BarButtonItemPopover.Delegate = _popoverDelegate;
}

public class PopoverDelegate : UIPopoverControllerDelegate {
     public PopoverDelegate() { }

     public override void DidDismiss (UIPopoverController controller) {
           string mike = "Dismissed";
     }

     public void updateSomething(string someData) {
           // When the user clicks in my popOverViewController I want to come
           // here and do something.  I will then dismiss the popover here.
           string mike = someData;
     }
}

My popOverViewController is set up as UIViewController, with a button on it called btnClickMe and the key bit is this:

 public override void ViewDidLoad () {
      base.ViewDidLoad ();
      this.btnClickMe.TouchUpInside += (s, e) => {
            Console.WriteLine("");
             // When I'm clicked I want to send some 
             // data to the updateSomething("hello world") method
             // in the ViewController that crated me! Help!
        };
 }

I have debugged and when I dismiss the Popover in the simulator the Delegate fires and string mike in my calling ViewController does equal “Dismissed”.

What I simply cannot understand or find out is how you get the updateSomething() method to be called/referenced/fired from the popoverViewController. I have looked at numerous examples of people using UIPopover but no-one seems to have an example of doing this in Monotouch there all in Objective C. Does this mean it’s not possible? Or is it for very experience people only?

If I’m honest I thought it would be easier in Monotouch than Objective C as I am an experienced C# developer but at the moment I think it would be easier to learn Objective C!!

I hope someone can help me as I’m getting very confused/frustrated.

Thanks

Mike

  • 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-07T12:24:20+00:00Added an answer on June 7, 2026 at 12:24 pm

    There are many ways to solve this problem.

    Here is the simplest:

    • Add a property to your PopoverViewController that contains your PopoverDelegate
    • From your button click handler, call YourNewProperty.updateSomething("peppers")

    To solve problems like these in general, I use a global “messenger” class. This allows other controllers, delegates, classes, etc. to subscribe to events in a global way and need to necessarily know where they came from. It really helps with this crazy version of MVC Apple came up with.

    I use the one from TinyIoC, but it has a bit of a learning curve to set up: https://github.com/grumpydev/TinyIoC/blob/master/src/TinyIoC/TinyMessenger.cs

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

Sidebar

Related Questions

I've set myself a simple programming challenge in C# to optimise capacity. I didn't
I'm learning winforms and I have set myself a simple goal of making a
I set myself this rather simple sounding challenge but now I am stuck trying
FOUND THE ANSWER MYSELF, see below... I'd like to have a very simple user
I have set up 2 servers which are linked. From my LOCAL SERVER, I
I'm new to Java, and have set myself a project to write so that
I have a simple question, but I couldn't solve it by myself. I made
I've recently set some coursework for some undergraduate students for which they have to
I have a set of Div's which act as buttons. These buttons have a
There is a minor annoyance I find myself with a lot - I have

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.