dismissing modalview is not working
<p>i m presenting modalviewcontroller without using delegate protocol. But want to dismiss modalviewcontroller using delegate protocol. </p>

<p>Basically i m pushing modalviewcontroller like this</p>

<pre><code>- (void)displayModalViewaction: (id) sender 
 {
self.view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

self.viewController = [[Infoviewcontroller alloc] init];

[self.view setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];


UINavigationController *navigationController=[[UINavigationController alloc] init];

navigationController.navigationBar.tintColor = [UIColor brownColor]; 

[navigationController pushViewController:_viewController animated:YES];

[self.view addSubview:navigationController.view];

[_viewController release];

[navigationController release];

}
</code></pre>

<p>For dismissing modalview doing this</p>

<p>In the ModalViewController.h delegated protocol and method</p>

<pre><code> @protocol ModalViewDelegate &lt;NSObject&gt;

 -(void) dismissModalView:(UIViewController *) viewController;

 @end

 @interface Infoviewcontroller : UIViewController &lt;ModalViewDelegate&gt;

 {
    id&lt;ModalViewDelegate&gt; dismissDelegate;
  }

@property (nonatomic, retain) id&lt;ModalViewDelegate&gt; dismissDelegate;

@end
</code></pre>

<p>In modalviewcontroller. m file</p>

<pre><code>@synthesize dismissDelegate;

-(void) dismissModalView:(UIViewController *) viewController;
{

   [self dismissModalViewControllerAnimated:YES];

 }
  @end

   -(void) dismissView: (id)sender

  {
    [delegate dismissModalView:self];

 }

 -(void) dismissModalView:(UIViewController *) viewController;
{

 [self.dismissModalViewController Animated:YES];

}

@end
</code></pre>

<p>But somehow it is not working when clicking on done button</p>

<pre><code> 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];
</code></pre>

<p>Anyone have any clue that what i m missing in my code or what i m doing wrong. Help will be really appreciated.</p>

<p>Thanks</p>
