2010-04-07 14 views
6

Aparece el error raro.wait_fences: no se pudo recibir respuesta: 10004003 - ¿qué?

heres the deal - en el siguiente método tengo una vista de alerta subir, tomar una U/N y PW, luego intentaré iniciar otro método.

El método

-postTweet 

no consigue activar

apenas consigo este error en la consola

wait_fences: failed to receive reply: 10004003 

que es realmente extraño - como nunca he visto antes

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ 
    if (alertView == completeAlert) { 
     if (buttonIndex ==1) { 
      passPromtAlert = [[UIAlertView alloc] initWithTitle:@"Enter Name" message:@"Please enter your Username and password - they will be saved\n" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Tweet", nil]; 
      [passPromtAlert addTextFieldWithValue:@"" label:@"Enter username"]; 
      [passPromtAlert addTextFieldWithValue:@"" label:@"Enter password"]; 

      textField = [passPromtAlert textFieldAtIndex:0]; 
      textField2 = [passPromtAlert textFieldAtIndex:1]; 
      textField.clearButtonMode = UITextFieldViewModeWhileEditing; 
      textField.keyboardType = UIKeyboardTypeAlphabet; 
      textField.keyboardAppearance = UIKeyboardAppearanceAlert; 
      textField.autocapitalizationType = UITextAutocapitalizationTypeWords; 
      textField.autocorrectionType = UITextAutocapitalizationTypeNone; 
      textField.textAlignment = UITextAlignmentCenter; 

      textField2.secureTextEntry = YES; 

      textField2.clearButtonMode = UITextFieldViewModeWhileEditing; 
      textField2.keyboardType = UIKeyboardTypeAlphabet; 
      textField2.keyboardAppearance = UIKeyboardAppearanceAlert; 
      textField2.autocapitalizationType = UITextAutocapitalizationTypeWords; 
      textField2.autocorrectionType = UITextAutocapitalizationTypeNone; 
      textField2.textAlignment = UITextAlignmentCenter; 

      [passPromtAlert show]; 
     } 
    } 
    if (alertView == passPromtAlert) { 
     if (buttonIndex == 1) { 
     NSLog(@"here");   
     [self postTweet]; 
     } 
    } 
} 

Cualquier ayuda se agradece

Gracias

Sam

añadido:

Si necesita ver más código, a continuación, que me haga saber

+0

¿Tal vez vea esta pregunta? http: // stackoverflow.com/questions/1371346/wait-fences-failed-to-receive-reply-10004003 –

+0

Resolví el mismo problema en mi proyecto. Espero que también puedas resolverlo usando la respuesta que publiqué a continuación. – AppAspect

+0

Entonces, puede resolver ese problema. Eso es realmente bueno. Avíseme si quiere más ayuda en cualquier momento. – AppAspect

Respuesta

6

Aquí también estaba frente a la misma problema en mi proyecto y logré resolver el problema ahora. Necesita llamar al método usando NSTimer.

Entonces, aquí está llamando a una alerta dentro de otra alerta significa cuando una alerta descarta la nueva alerta que está llamando allí . No hay problema en eso. Puedes hacerlo fácilmente. En lugar de definir la vista de alerta en el interior el método "- (void) alertView: (UIAlertView *) alertView clickedButtonAtIndex: (NSInteger) buttonIndex { if (alertView == completeAlert)", puede crear un método, p. "Show_AlertMessage" y llámalo usando un temporizador como este.

[NSTimer scheduledTimerWithTimeInterval:0.001 target:self selector:@selector(Show_AlertMessage) userInfo:nil repeats:NO]; 

Avíseme si puede deshacerse de este problema. Resolveremos este problema como lo hice por mi parte.

1

Creo que el problema es causado por usted creando otra vista de alerta antes de descartar la primera. Como se supone que solo una vista de alerta está presente en cualquier persona una vez, la segunda vista de alerta está pisando la primera.

Debe descartar la primera vista antes de crear y mostrar la segunda.

+0

no descartar la vista no es la razón principal del error. Sin embargo, es algo que debería arreglarse. – psychotik

-1

Su UITextField* no está renunciando a su estado de primer respondedor antes de descartar la alerta.

Esto ensucia la cadena de respuesta. Añadir [textField resignFirstResponder] o [textField2 resignFirstResponder] según sea el caso en la implementación UIAlertViewDelegate (alertView:clickedButtonAtIndex:)

Además, programar su segunda UIAlertView para mostrar después de la primera es despedido (se puede hacer esto utilizando (performSelector:withObject:afterDelay:)

0

¡La solución está aquí! Tuve el mismo error, ahora tengo la solución, esto puede ser útil. Use este delegado de AlertView

- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex{ 
Cuestiones relacionadas