wait_fences:未能收到回复:10004003 - 什么?

发布于 2024-08-27 18:53:43 字数 2147 浏览 4 评论 0原文

一直收到这个奇怪的错误。

协议如下 - 在下面的方法中,我会出现一个警报视图,获取 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];
        }
    }
}

任何帮助将不胜感激

感谢

山姆

添加:

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

Been getting this odd error.

heres the deal - in the below method i have an alert view come up, take a U/N and PW, then atempt to start another method.

The method

   -postTweet

does not get activated

I just get this error in console

 wait_fences: failed to receive reply: 10004003

Which is really odd - as ive never seen it before

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

Any help would be appreciated

Thanks

Sam

ADDED:

If you need to see more code, then let me know

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

听风吹 2024-09-03 18:53:43

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

因此,在这里您在另一个警报中调用一个警报意味着当一个警报解除时,您在那里调用新的警报。这没有问题。你可以轻松做到。而不是在方法内定义alertview“ - (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];

如果您可以解决这个问题,请告诉我。我们将像我为我这边所做的那样解决这个问题。

Here I was also facing the same issue in my project and I managed to solve the issue now. You need to call the method using NSTimer.

So, Here you are calling one alert inside another alert means when one alert dismiss then the new alert you are calling there. There is no problem in that. You can do it easily. Instead of defining alertview inside the method "- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (alertView == completeAlert )", You can create one method e.g. "Show_AlertMessage" and call it using timer like this.

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

Let me know if you can get rid of this issue. We will solve this issue as I did for my side.

澜川若宁 2024-09-03 18:53:43

我相信问题是由于您在关闭第一个警报视图之前创建了另一个警报视图而引起的。由于任何人一次都应该只出现一个警报视图,因此第二个警报视图会踩在第一个警报视图上。

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

I believe the problem is caused by you creating another alert view before you dismiss the first one. Since only one alert view is supposed to be present at anyone one time the second alert view is stepping on the first one.

You need to dismiss the first view before creating and showing the second.

陈独秀 2024-09-03 18:53:43

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

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

Solution is here! I had same error, now i got the solution, this may help you. Use this delegate of AlertView

- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex{
微凉徒眸意 2024-09-03 18:53:43

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

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

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

Your UITextField* isn't resigning its firstresponder status before the alert is dismissed.

This messes up the responder chain. Add [textField resignFirstResponder] or [textField2 resignFirstResponder] as applicable in the UIAlertViewDelegate implementation (alertView:clickedButtonAtIndex:)

Also, schedule your second UIAlertView to show after the first is dismissed (you can do this using (performSelector:withObject:afterDelay:)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文