Program received signal EXC_BAD_ACCESS
<p>When i click on done button which has code </p>

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

self.navigationItem.rightBarButtonItem=UIBarButtonSystemItemDone;
[[self navigationItem] setRightBarButtonItem:button];
[button release];

-(void)dismissView: (id)sender

{

[self.navigationController popToRootViewControllerAnimated:YES];

}
</code></pre>

<p>application crashes and gives message Program received signal EXC_BAD_ACCESS</p>

<p>Any ideas what is wrong.</p>

<p>Thanks for help.</p>
