I'm implementing a very simple iOS application just to practice showing a pop up alert in, and I get an error when I press the alert button:

> 
> Thread 1:EXC\_BAD\_ACCESS(code=1,address=0x676f6f57)
> 
> 
> 

This is the code: 

```
- (IBAction)AlertButton {

    alert = [[UIAlertView alloc]
         initWithTitle:@"Alert" message:@"Alert"
         delegate:self
         cancelButtonTitle:@"Dismiss"
         otherButtonTitles:@"Apple", "Google" ,nil];
    [alert show];}

-(void)alertView :(UIAlertView *)alertView clickedButttonAtIndex:(NSInteger)buttonIndex{

    if(buttonIndex == 1){
        [[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"http://apple.com"]];
    }
    if(buttonIndex == 2){
        [[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"http://google.com"]];
    }}

```