I have a GLKView because I use some OpenGLES for some animations with some graphics. All these animations are working very good until I implement a viewWillAppear method.

I have two timers intialized in the viewDidLoad:

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 tells me that the two methods (updateScene and paintScene) are called correctly and my graphics are changed correctly.

Now as long as I have no viewWillAppear method everything animates fine. When I implement a viewWillAppear method, updateScene and paintScene are still called but nothing changes. no animation. viewWillAppear is empty. no code inside.

Why are all animations blocked?

有帮助吗?

解决方案

Make sure viewWillAppear calls [super viewWillAppear:animated];
This may fix your problem. Per Apple's docs:

If you override this method, you must call super at some point in your implementation.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top