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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:36:58+00:00 2026-06-16T00:36:58+00:00

I have an iPad view that presents a modal form sheet that is essentially

  • 0

I have an iPad view that presents a modal form sheet that is essentially a ‘settings’ view.
From there the user can go to a specific setting. I need to be able to refresh the main iPad view when the modal view is dismissed.

Therefore, I need a delegate protocol to call -(void)refreshTable when the modal view is dismissed. This wouldn’t be a problem except when I present the modal view, the delegate I need to assign, is a view that is ‘pushed’ from the presented view. (Screenshot)

enter image description here

Here is how I’m presenting the modal form sheet:
I’m encapsulating it in a UINavigationController because it needs to push other views.
(I would just assign the delegate here, but the view with the protocol gets pushed from AddView) NewAftpViewController is the view controller which has the protocol.

-(void)presentAddView:(id)sender {

    AddView *avc = [self.storyboard instantiateViewControllerWithIdentifier:@"add"];
    UINavigationController *navcont = [[UINavigationController alloc] initWithRootViewController:avc];
    navcont.modalPresentationStyle = UIModalPresentationFormSheet;
    [self presentViewController:navcont animated:YES completion:NULL];
}

And here is my protocol in the pushed view:

@protocol RefreshAfterAddingNewAftpDelegate
-(void)refreshTable;
@end

@interface NewAftpViewController : UIViewController

@property (nonatomic, retain) id <RefreshAfterAddingNewAftpDelegate> refreshAfterAddingNewAftpDelegate;

@end
  • 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-16T00:36:59+00:00Added an answer on June 16, 2026 at 12:36 am

    I can see two ways to do this. You should be able to get a reference to that left most controller in your post with [self.navigationController presentingViewController] — you’ll need to cast self.navigationController to whatever class that is. Then in your NewAftpViewController, you can set the delegate like this:

    self.delegate = [(cast here)self.navigationController presentingViewController];
    

    But this seems to defeat the purpose of using a delegate — the delegator is not supposed to know what class the delegate is, but here you have to set it explicitly. Instead of using a delegate, you could just call a method on that controller directly.

    I think the better way, in situations like this, is to use an NSNotification. That seems cleaner and simpler to me. Just post a notification from NewAftpViewController, and have your first controller listen for it.

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

Sidebar

Related Questions

I have a modal view controller that I am presenting on iPad via: vc.modalPresentationStyle
I have an iPad Split View Application that brings up a modal view to
I have an iPad application that can be used in all four view modes
I'm making an application for the iPad. I have a view controll that has
I have created an iPad app that has 10 view controllers that swipe left
I am writing an iPad app that presents user documents similar to the way
I have defined in my Storyboard (iPad) a view that contains a UICollectionView ,
I have a button that when pressed shows presents a view controller, this is
I have a complex iPad view that I manage by having several view controllers.
I have an iPad game that I only want to see in landscape view.

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.