一直收到这个奇怪的错误。
事情是这样的 - 在下面的方法中,我会出现一个警报视图,获取 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];
}
}
}
任何帮助,将不胜感激
Thanks
Sam
ADDED:
如果您需要查看更多代码,请告诉我
我在项目中也遇到了同样的问题,现在我设法解决了这个问题。您需要使用 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];
让我知道您是否可以解决这个问题。我们将像我为我这边所做的那样解决这个问题。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)