Tornar o bloqueio do UIAlertView

Eu preciso fazerUIAlertView bloqueio. Porque eu tenho função e preciso retornarUIAlertView escolha. Mas o problema é que depoisUIAlertView é mostrado meu código de função está executando ainda mais, então eu não consigo pegarUIAlertView escolha (eu posso fazê-lo em métodos de delegação, mas preciso retornar o resultado da função).

Eu tentei fazerUIAlertVIew bloqueando comNSCondition. Mas o código não funciona.

condition = [NSCondition new];
result = 0 ; 
[condition lock];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Fingerprint" message:@"test" delegate:window_self cancelButtonTitle:@"No" otherButtonTitles:@"Yes",nil];
[alert setDelegate:self];
[alert show];
while (result == 0) [condition wait];
[condition unlock] ;

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
 [condition lock] ;
 if (buttonIndex == 0)
 {
  result = 2; 
 }
 else if (buttonIndex == 1)
 {
  result = 3 ;
 }
 [condition signal] ;
 [condition unlock] ;
}

Talvez como corrigir esse código ou outras sugestões? obrigado

questionAnswers(5)

yourAnswerToTheQuestion