Try
- (IBAction)xButton
{
NSString *title;
if ([_hasUserTakenAPhoto isEqual:@"YES"])
{
_xButtonAfterPhotoTaken = [[UIActionSheet alloc] initWithTitle:@"Delete" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:nil];
[_xButtonAfterPhotoTaken showInView:self.view];
title = [_xButtonAfterPhotoTaken buttonTitleAtIndex:1];
if ([title isEqualToString:@"Delete"])
{
[self performSegueWithIdentifier:@"backToHomeFromMediaCaptureVC" sender:self];
}
}
else
{
[self performSegueWithIdentifier:@"backToHomeFromMediaCaptureVC" sender:self];
}
}