L'utilisation de ce pour UIAlertViewUIAlertController comment ajouter la valeur tag obj c
- (void) alertStatus:(NSString *)msg :(NSString *)title :(int) tag
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title
message:msg
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil, nil];
alertView.tag = tag;
[alertView show];
}
Mais maintenant UIAlertView se dépréciée. changer mon code
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* MyAlert = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
[alertController addAction:MyAlert];
[self presentViewController:alertController animated:YES completion:nil];
Voici comment peut transmettre cette valeur tag
alertView.tag = tag;
Aide comment transmettre la valeur tag UIAlertController. Merci d'avance.
- (void) alertView: (UIAlertView *) alertView clickedButtonAtIndex: (NSInteger) buttonIndex cela aussi dépréciée comment résoudre tis. – saravanar
@saravanar - attendez Je mets à jour la réponse –
@saravanar inutile d'utiliser le délégué 'UIAlertView'. Utilisez 'UIAlertController' seulement au lieu de' UIAlertView' –