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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:43:02+00:00 2026-05-28T03:43:02+00:00

When i click on the done button it is not dismissing modalviewcontroller in my

  • 0

When i click on the done button it is not dismissing modalviewcontroller in my case it is infoviewcontroller. Am i supposed to add something in mainviewcontroller h and m file.

In the Infoviewcontroller.h

#import <UIKit/UIKit.h>

@protocol ModalViewDelegate <NSObject>

-(void) dismissModalView;

@end

@interface Infoviewcontroller : UIViewController <UITextViewDelegate>

{
id<ModalViewDelegate>dismissDelegate;
UITextView *textView;
UINavigationBar *navBar;

}

@property (nonatomic, retain) UITextView *textView;
@property (nonatomic, assign) UINavigationBar *navBar;
@property (nonatomic, assign) id<ModalViewDelegate>dismissDelegate;

@end

In the Infoviewcontroller.m

#import "Infoviewcontroller.h"
#import <QuartzCore/QuartzCore.h>


@implementation Infoviewcontroller

@synthesize textView;
@synthesize navBar;
@synthesize dismissDelegate;



-(void)dealloc
{
[textView release];
[navBar release];
[super dealloc];
}

- (void) viewDidLoad
{
  [super viewDidLoad];

    UIButton* backButton = [UIButton buttonWithType:101]; 
    [backButton addTarget:self action:@selector(dismissView:) forControlEvents:UIControlEventTouchUpInside];
    [backButton setTitle:@"Done" forState:UIControlStateNormal];

    // create button item
    UIBarButtonItem* backItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];

    // add the button to navigation bar
    self.navigationItem.leftBarButtonItem = backItem;
    [backItem release];

 -(void)dismissView:(id)sender
{
    //Make the delegate close the modal
    [self.dismissDelegate dismissModalView];

}

When i click on the done button it is not dismissing modalviewcontroller in my case it is infoviewcontroller. Am i supposed to add something in mainviewcontroller h and m file. Please help me if i am missing some thing in the mainviewcontroller files.

Thanks for help,

  • 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-28T03:43:03+00:00Added an answer on May 28, 2026 at 3:43 am
    -(void)dismissView:(id)sender
    {
           [self dismissModalViewControllerAnimated:YES];
    
    }
    

    but if you want to dismiss the controller in the delegate method then you first have to set the delegate in infoviewController then in the delegate method use the infoviewController object to dismiss it .

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

Sidebar

Related Questions

I am running a html file in which when I click the submit button
I want to resign keyboard on click of 'Done' button on keyboard. How can
I would like to add a button to my website so when people click
I use this to hide keyboard when i click done button or outside of
I have some Javascript that dynamically adds rows/fields when you click the button, Add
In jQuery, I've done stuff like this in the past: $('#someCheckbox').click(); And everything works
User click on a link button and it will direct them to a url
When click a button,I want to popup a view form bottom,like this! Any help
I click on items in my listbox and then hit a submit button, but
I have an Index.aspx page with a button. If you click the button a

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.