Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Niiro13

macrumors 68000
Original poster
Feb 12, 2008
1,719
0
Illinois
Hi!

Basically, I have a menu view. When you click a button, the menu adds the respective view as a subview.

Now when I remove the view from the menu superview, the timers aren't released. In fact, nothing is. The view disappears, but everything that's going on still happens (timers, sounds, accelerometers).

I have tried remaking the whole thing in a navigation controller and popping the view controller, but it still doesn't work.

Any suggestions? Thanks!
 

chbeer

macrumors member
Sep 22, 2008
82
0
Berlin
What did you do to stop the timer, accelerometer events? If you did not stop them the behavior is correct, I think. It can be your intention to remove the view but keep it working in background.
 

Niiro13

macrumors 68000
Original poster
Feb 12, 2008
1,719
0
Illinois
Oh...in that case, I am having trouble stopping the timer as the invalidate method seems to only work if the timer and the invalidate are in the same method (which they're not, because it's a button press that removes the view...which makes the most sense, I think).

Edit: Nevermind. I found out that I only invalidated the second timer which was useless since the first timer was still being called and therefore, still creating the second timer making it look like it wasn't invalidated.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.