2013-06-28 5 views
0

그래픽이있는 일부 애니메이션에 대해 일부 OpenGLES를 사용하기 때문에 GLKView가 있습니다. viewWillAppear 메서드를 구현할 때까지 이러한 모든 애니메이션이 매우 잘 작동합니다.viewWillAppear 모든 애니메이션을 차단합니다.

updateTimer = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(updateScene) userInfo:nil repeats:YES]; 
paintTimer = [NSTimer scheduledTimerWithTimeInterval:0.02 target:self selector:@selector(paintScene) userInfo:nil repeats:YES]; 

NSLog는 두 가지 방법 (updateScene 및 paintScene가) 제대로 라고 내 그래픽이 올바르게 변경 하더군요 :

는 내가있는 viewDidLoad에 intialized 2 개 개의 타이머가있다.

이제 viewWillAppear 메서드가 없으면 모든 것이 잘 움직입니다. viewWillAppear 메서드를 구현할 때 updateScene 및 paintScene은 여전히 ​​ 이지만 아무것도 변경되지 않습니다. 애니메이션 없음. viewWillAppear이 비어 있습니다. 안쪽에 코드가 없습니다.

왜 모든 애니메이션이 차단 되었습니까?

답변

0

viewWillAppear가 [super viewWillAppear : animated]를 호출하는지 확인합니다.
문제가 해결 될 수 있습니다. Apple의 문서 별 :

이 방법을 재정의하는 경우 구현의 어느 시점에서 super를 호출해야합니다.

관련 문제