2012-05-19 2 views
0

Мое приложение при сбое, когда я выхожу на контроллер корневого представления в событии click UIAlertView.'wait_fences: не удалось получить ответ: 10004003' в iPhone

мой код, как показано ниже:

- (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"); 
    } 
} 

Я попытался, заменив clickedButtonAtIndex с didDismissWithButtonIndex методом. Но результата я не получаю.

Спасибо.

+0

Если ** popToRootViewControllerAnimated ** является последней строкой if contition, что происходит? –

+0

Если popToRootViewControllerAnimated является последней строкой, проблема с крахом не решена. – Rajesh

ответ

0

Попробуйте переместить [self.navigationController popToRootViewControllerAnimated: YES] в нижней части функции (то есть после запуска всего другого кода).

+0

попробуйте это, но не получится. – Rajesh

Смежные вопросы