wait_fences:收不到回复:10004003 - 什么?

时间:2010-04-07 08:30:29

标签: iphone-sdk-3.0 uitextfield uialertview

得到了这个奇怪的错误。

继续交易 - 在下面的方法中,我有一个警报视图,拿一个U / N和PW,然后尝试启动另一种方法。

方法

   -postTweet

未激活

我刚在控制台

中收到此错误
 wait_fences: failed to receive reply: 10004003

这真的很奇怪 - 因为我以前从未见过它

- (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];
        }
    }
}

任何帮助将不胜感激

由于

萨姆

增加:

如果您需要查看更多代码,请告诉我

4 个答案:

答案 0 :(得分:6)

我在项目中也遇到了同样的问题,现在我设法解决了这个问题。您需要使用NSTimer调用该方法。

所以,在这里,您在另一个警报内调用一个警报意味着当一个警报解除时,您将在那里呼叫新警报。这没有问题。你可以轻松地做到。而不是在方法中定义alertview“ - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {     如果(alertView == completeAlert)“,您可以创建一个方法,例如”Show_AlertMessage“,并使用这样的计时器调用它。

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

如果你能摆脱这个问题,请告诉我。我们将像我一样为这个问题解决这个问题。

答案 1 :(得分:1)

我认为问题是由您在解雇第一个警报视图之前创建另一个警报视图引起的。由于任何人一次只能出现一个警报视图,因此第二个警报视图踩在第一个警报视图上。

您需要在创建和显示第二个视图之前关闭第一个视图。

答案 2 :(得分:0)

解决方案在这里!我有同样的错误,现在我得到了解决方案,这可能对你有帮助。使用AlertView的委托

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

答案 3 :(得分:-1)

在警报解除之前,您的UITextField*并未撤销其第一响应者状态。

这会扰乱响应者链。在UIAlertViewDelegate实现中添加[textField resignFirstResponder][textField2 resignFirstResponder]alertView:clickedButtonAtIndex:

另外,安排第二个UIAlertView在第一个被解雇后显示(你可以使用(performSelector:withObject:afterDelay: