Dismiss ModalView Programmtically by done button
<p>I have to click on done button to dismiss modalview programmatically. I think <code>UIButton</code> is better than <code>UIBarButtonItem</code> to add <code>UIControlEventsTouchupInside</code>.</p>

<p>But with <code>UIButton</code> I'm confused what buttontype should use.</p>

<pre><code>   UIButton *button = [UIButton buttonWithType:UIButtonTypeInfoLight];

[button addTarget:self action:@selector(displayModalViewaction:) forControlEvents:UIControlEventTouchUpInside];    

  UIBarButtonItem * button = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
                                                                          target:self
                                                                          action:@selector(dismissViewaction:)] autorelease];
</code></pre>

<p>Anyone's help will be appreciated.</p>

<p>Thanks</p>
