【问题标题】:wait_fences: failed to receive reply: 10004003 - what?wait_fences:未能收到回复:10004003 - 什么?
【发布时间】:2011-02-05 03:58:03
【问题描述】:

遇到这个奇怪的错误。

这就是交易 - 在下面的方法中,我有一个警报视图出现,获取一个 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];
        }
    }
}

任何帮助将不胜感激

谢谢

山姆

添加:

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

【问题讨论】:

  • 也许看到这个问题? stackoverflow.com/questions/1371346/…
  • 我在我的项目中解决了同样的问题。希望您也可以使用我在下面发布的答案来解决同样的问题。
  • 所以,你可以解决这个问题。这非常好。如果您需要更多帮助,请随时告诉我。

标签: iphone-sdk-3.0 uitextfield uialertview


【解决方案1】:

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

因此,在这里您在另一个警报中调用一个警报意味着当一个警报消失时,您将在那里调用新警报。这没有问题。你可以轻松做到。而不是在方法“- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ if (alertView == completeAlert )", 您可以创建一种方法,例如“Show_AlertMessage”并使用这样的计时器调用它。

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

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

【讨论】:

    【解决方案2】:

    我相信问题是由于您在关闭第一个警报视图之前创建了另一个警报视图。因为一旦第二个警报视图踩到第一个警报视图时,任何人都应该只出现一个警报视图。

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

    【讨论】:

    • 不关闭视图不是错误的主要原因。不过,这是应该解决的问题。
    【解决方案3】:

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

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

    【讨论】:

      【解决方案4】:

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

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

      另外,安排您的第二个 UIAlertView 在第一个关闭后显示(您可以使用 (performSelector:withObject:afterDelay:) 执行此操作

      【讨论】:

        猜你喜欢
        • 2011-05-02
        • 2010-11-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-22
        • 2012-09-17
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多