2012-05-19 73 views
0

當我在UIAlertView的點擊事件中彈出到根視圖控制器時,我的應用程序崩潰。iPhone中的'wait_fences:無法接收回復:10004003'

我的代碼如下:

- (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嘗試。但我沒有得到任何結果。

謝謝。

+0

如果** popToRootViewControllerAnimated **是如果contition的最後一行,會發生什麼情況? –

+0

如果popToRootViewControllerAnimated是最後一行,則崩潰問題未解決。 – Rajesh

回答

0

嘗試將[self.navigationController popToRootViewControllerAnimated:YES]移至該函數的底部(即,在所有其他代碼已經運行之後)。

+0

試試這個,但沒有得到任何結果。 – Rajesh

相關問題