3
-(void)buPressed{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Game Over"
message:@"YOU LOST! ALL YOUR BASE ARE BELONG TO US!"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Publish", nil];
[alertView show];
[alertView release];
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if(buttonIndex==0){
NSLog(@"%d",buttonIndex);
}
else{
[self bPressed];
}
}
-(void)bPressed{
ModalViewConroller *yeniSayfa=[[ModalViewConroller alloc] init];
yeniSayfa.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:yeniSayfa animated:YES];
[yeniSayfa release];
//Restore to Defaults
[button_1 setSelected:NO];
[button_2 setSelected:NO];
[button_3 setSelected:NO];
[button_4 setSelected:NO];
[button_5 setSelected:NO];
[button_6 setSelected:NO];
slider.value=50.00;
UIImage *image = [UIImage imageNamed:@"Smiley_00025.png"];
imageView = [[UIImageView alloc] initWithImage:image];
imageView.frame = CGRectMake(81, 43, image.size.width, image.size.height);
[self.view addSubview:imageView];
}
這是我的代碼,我想使發佈按鈕來調用bPressed函數,但它是給出警告和程序崩潰時,我觸摸發佈按鈕我想打開一個modalview時,我推按鈕發佈可以任何人幫我?UIAlertView按鈕如何調用另一個函數?
你得到哪些警示? –
方法-bPressed找不到 –
你在頭文件中指定了這個方法嗎? –