내가이 시도 UIAlert변경 스토리 보드는
을 통해 게임에서 메인 메뉴를 클릭 한 후 주 메뉴로 변경하고자 누르면 :
-(void)gameOver
{
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Time's up!"
message:[NSString stringWithFormat:@"You've scored: %i points!", scoreCounter]
delegate:self
cancelButtonTitle:nil
otherButtonTitles:@"Submit to Leaderboards",@"Play Again",@"Main Menu", nil];
[alert show];
}
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1) {
[self toMain];
}
if (buttonIndex == 2) {
[self toMain];
}
if (buttonIndex == 3)
{
[self toMain];
}
}
-(void)toMain
{
mainMenu *main = [[mainMenu alloc] initWithNibName:nil bundle:nil];
[self presentViewController:main animated:YES completion:NULL];
}
전혀 아무것도하지 않습니다 ...
EDIT
[자동 대문] 이후 검은 색 화면으로 바뀌는 버튼 인덱스를 수정했습니다.
당신은 당신의'* 파일 .h'에서' Protocol'를 추가합니까? –
Stone
프로토콜을 명시 적으로 선언해도 아무런 영향이 없어야하지만 좋은 생각입니다. – powerj1984