2009-10-06 9 views
0

난 다음 실행하면이 오류를 제공, 현재의 컨트롤러는 테이블 컨트롤러 ....presentModalViewController가 오류를 발생시킵니다.

SetController *aSecondView = [[SetController alloc] initWithNibName:@"Sets" bundle:nil]; 
SchedAppDelegate *mainDelegate = (SchedAppDelegate *)[[UIApplication sharedApplication] delegate]; 
    [mainDelegate setSettingsViewController:aSecondView]; 
    [UIView beginAnimations:nil context:NULL]; 
    [UIView setAnimationDuration:2.0]; 
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:[[self view] superview] cache:YES]; 
    [self.view removeFromSuperview]; 
    [self presentModalViewController:aSecondView animated:NO]; 
    //[aSecondView release]; 
    [UIView commitAnimations]; 

답변

3

mViewUIViewController 아닌 UIView 것으로 나타납니다.

이 모달 뷰 컨트롤러에 사용자 지정 애니메이션을 적용 할 수있는 적절한 방법 : MVIEW가 뷰 컨트롤러 인 경우

[UIView beginAnimations:nil context:NULL]; 
[UIView setAnimationDuration:2.0]; 
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:[self view] cache:YES]; 
[self presentModalViewController:mView animated:NO]; 
[UIView commitAnimations]; 
+0

실행 했습니까? UIViewAnimationTransitionFlipFromRight에 대해 작동하지 않았습니다. –

+0

forView : [[self view] superview] 대신 시도 했습니까? 또한 코드가 없으므로 테스트 할 수있는 방법이 없습니다 – rpetrich

+0

시도했습니다. 그러나 나는 그것을 할 수 없었다. 나는 나의 완전한 부호로 편집했다 u는보고 대답 할 수 있는가? –

3

, 당신이 수행하여 플립 애니메이션을 제시 할 수있는 사항은 다음과 같습니다

mView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; 
[self presentModalViewController:mView animated:YES]; 

modalTransitionStyle 속성은 iPhone OS 3.0 이상에서만 사용할 수 있습니다. 희망이 도움이됩니다. :)

관련 문제