【问题标题】:'wait_fences: failed to receive reply: 10004003' in iPhoneiPhone中的“wait_fences:未能收到回复:10004003”
【发布时间】:2012-05-19 06:17:17
【问题描述】:

当我在 UIAlertView 的点击事件中弹出到根视图控制器时,我的应用程序崩溃了。

我的代码如下:

- (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
    if (buttonIndex == 0 && ([errorCodeNew  isEqualToString:@"IPH_I_LGN_002"])){

     [self.navigationController popToRootViewControllerAnimated:YES];

    AppDelegate *appDelegate =  (AppDelegate*)[[UIApplication sharedApplication] delegate];
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setObject:@"3" forKey:@"CurrentSize"];

    NSMutableArray *nsmarrJpName;
    DatabaseLogic *logic = [[DatabaseLogic alloc] init];
    appDelegate.anket_id = [logic getAnketID];

    nsmarrJpName = [[NSMutableArray alloc]initWithArray:[logic getDetailScreenItems:[logic getAnketID]] copyItems:YES];

    for (int i = 0;  i < [nsmarrJpName count]; i++) {
        NSString *strKey = [nsmarrJpName objectAtIndex:i];
        [defaults setObject: [NSNumber numberWithBool:YES] forKey:strKey];
        NSLog(@"key : %@", strKey);
    }

    [nsmarrJpName removeAllObjects];
    [nsmarrJpName release];

    appDelegate.strUserFlg = [logic getUserType];

    [logic release]; logic = nil;

    //start download process
    [[NSNotificationCenter defaultCenter] postNotificationName:LOGIN_COMPLETE_NOTIFICATION object:self userInfo:nil];
    }else{
        NSLog(@"cancel");
    }
}

我尝试用didDismissWithButtonIndex 方法替换clickedButtonAtIndex。但我没有得到任何结果。

谢谢。

【问题讨论】:

  • 如果 popToRootViewControllerAnimated 是 if contition 的最后一行,会发生什么?
  • 如果 popToRootViewControllerAnimated 是最后一行,则无法解决崩溃问题。

标签: iphone ios xcode


【解决方案1】:

尝试将 [self.navigationController popToRootViewControllerAnimated:YES] 移动到函数的底部(即在所有其他代码运行之后)。

【讨论】:

  • 试试这个但没有得到任何结果。
猜你喜欢
  • 1970-01-01
  • 2011-05-02
  • 2010-11-25
  • 2010-11-15
  • 1970-01-01
  • 1970-01-01
  • 2012-09-17
  • 1970-01-01
  • 2011-02-05
相关资源
最近更新 更多