affichage des alertes boutons

Je suis de la création d'une application iOS et lorsque le score atteint 100 cette alerte ne se montrent et tous fonctionnent très bien mais les boutons (action,la pomme,le taux de cette application).

     - (void) buttonAction {
                counter++;
                if(counter == 100)
                    [self showAlert];
            }

            - (void) showAlert {

                UIAlertView *alert = [[UIAlertView alloc]

                                      initWithTitle:@"hello"
                                      message:@"whats you name" 
                                      delegate:nil 
                                      cancelButtonTitle:@"Dismiss" 
                                      otherButtonTitles:@"share", @"apple" , @"rate this app", nil]; 


 -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
        if (buttonIndex == 0) { //means share button pressed
            //write your code here to do whatever you want to do once the share button is pressed
        }
        if(buttonIndex == 1) { //means apple button pressed
            //write your code here to do whatever you want to do once the apple button is pressed
        }
        //and so on for the last button
    }

                [alert show];



            }

            -(IBAction)plus {
                counter=counter + 1;
                count.text = [NSString stringWithFormat:@"%i",counter];
                if(counter == 100)
                    [self showAlert];

            }

            -(IBAction)zero {
                counter=0;
                count.text = [NSString stringWithFormat:@"%i",counter];
            }



        - (void)viewDidLoad {
            counter=0;
            count.text = @"0";
                [super viewDidLoad];

        }

ce que j'aimerais pas où puis-je ajouter le lien etc. merci

  • Je ne comprends pas ce que vous voulez.
  • juste une méthode vraiment pas comment je peut faire les boutons (apple etc aller à la site d'apple par exemple.
InformationsquelleAutor Picm | 2012-07-14