여기에 작은 문제가 있습니다. 나는 UIAlertView와 if 문을 사용하고 두 상황, 둘 다 UIAlertViews 결과. 그러나 한 상황에서 UIAlertView를 닫고 싶습니다. 다른 하나는 UIAlertView를 닫고 루트보기로 돌아 가기를 원합니다. 이 코드는 설명이 코드의 형식을 올바르게 지정하려면 어떻게해야합니까?
은 다음과 같습니다
if([serverOutput isEqualToString:@"login.true"]){
[Alert dismissWithClickedButtonIndex:0 animated:YES];
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
UIAlertView *success = [[UIAlertView alloc] initWithTitle:@"Success" message:@"The transaction was a success!"
delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[success show];
[success release];
} else {
UIAlertView *failure = [[UIAlertView alloc] initWithTitle:@"Failure" message:@"The transaction failed. Contact sales operator!"
delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[failure show];
[failure release];
}
}
-(void)alertView: (UIAlertView *)success clickedButtonAtIndex: (NSInteger)buttonIndex{
switch(buttonIndex) {
case 0: {
[self.navigationController popToRootViewControllerAnimated:YES];
}
}
}
그래서, 두 경우 모두, 그들은 위의 작업을 수행하지만, 분명히, 그게 내가 원하는 게 아니에요. 내가 여기서 뭘하는지에 대한 아이디어가 있니?
모르겠어요 ,하지만 거의 모든 것이 당신보다 낫습니다. 심한. – Pyrolistical
어떻게 그렇게 나쁜가요? – bear
여기에 어떤 질문이 있습니까? 이것은 코드를 포맷하는 것에 관한 것입니까, 아니면 alertviews에 관한 것입니까? –