누군가 게임을 마친 후 "최고점"게임을 검색하는이 문제에 직면합니다. 시간이 나는 내가 가지고있는이 gameEndingView의 주요 gameloop에 도달 점수를 표시 할 0presentModalViewController를 사용하여 xcode에서보기를 전환 할 때 점수 값 검색
GameEndingViewController *gameEndingView = [[GameEndingViewController alloc] initWithNibName:@"GameEndingViewController" bundle:nil];
gameEndingView.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:gameEndingView animated:YES];
[gameEndingView release];
에 도달하면
내가 presentModalViewController 메소드를 호출 : 내가 무슨 짓을 이이었다. 그러나 그것은 presentModalViewController 메서드를 사용하여보기를 전환 할 때와 같습니다. gameloop 중에 업데이트되는 변수 score가 재설정됩니다. 내 전체 게임 루프가보기 gameMainView에 있습니다.누군가가 presentModalViewController의 사용법에 대해 설명해 주며 문제를 어떻게 해결해야합니까?
대단히 감사합니다.
현재 컨트롤러 계층 구조에서 ** score ** var는 어느 컨트롤러에 속합니까? –
점수가 var는 mainViewController에 속합니다. – Jin
그래서 내가 한 것은 GameEndingViewController에 대한 viewdidload 일 때 appDelegate를 통해 0을 반환하는 mainViewController에서 score var를 검색합니다. – Jin