我正在創建一個iOS應用程序,當分數達到100時,此警報將顯示,並且它一切正常,但按鈕(共享,蘋果,評價這個應用程序)。警報視圖按鈕
- (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];
}
我想沒有我在哪裏可以添加鏈接等什麼謝謝
我不明白你想要什麼。 – 2012-07-14 11:52:36
@PrasadG只是一個方法真的如何我可以使按鈕(蘋果等去蘋果網站例如 – Picm 2012-07-14 12:08:50