Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 7    Views: 84

awesome123
Aspiring developer
Profile
Posts: 132
Reg: Dec 27, 2011
location unknow...
2,320
07/25/13 04:37 AM (12 years ago)

interactive quiz timer - simple question

hey guys how are you all doing? i've tweaked the interactive quiz plugin and set the timer for 20 seconds per question. everything is fine, all is working great. the problem im having is when i tap the back button the timer doesn't stop counting! it goes in the background and finish the quiz itself. and when it does it fires the quizEnd method and the action sheet pops up automatically even when im outside the quiz! so guys, my question is, how can i stop the timer when the user presses the back button?
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/25/13 05:34 AM (12 years ago)
create the method below find what the timer is called -(void)viewwilldisappeare{ [timername invalidate]; }
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/25/13 05:35 AM (12 years ago)
bare in mind above will not be spelt correctly but start typing the method the gist will appear
 
awesome123
Aspiring developer
Profile
Posts: 132
Reg: Dec 27, 2011
location unknow...
2,320
like
07/25/13 05:40 AM (12 years ago)
will test it out! thanks kittsy!
 
awesome123
Aspiring developer
Profile
Posts: 132
Reg: Dec 27, 2011
location unknow...
2,320
like
07/25/13 06:04 AM (12 years ago)
just finished trying and playing with it for a while and it is somehow working the problem im having now is the app crashes when the quiz ends and i click on the quit button from the action sheet it's probably because i'm killing the timer in the quizend method so it's being killed twice when i exit the screen?
 
awesome123
Aspiring developer
Profile
Posts: 132
Reg: Dec 27, 2011
location unknow...
2,320
like
07/25/13 06:09 AM (12 years ago)
i think i fixed the crash issue. i just created a if (quizRunning) statement inside the viewwilldisappear method!
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/25/13 06:10 AM (12 years ago)
happy days, it's hard to diagnose without having xcode in front of me
 
awesome123
Aspiring developer
Profile
Posts: 132
Reg: Dec 27, 2011
location unknow...
2,320
like
07/25/13 07:08 AM (12 years ago)
yeah :) thanks for the quick response though! really appreciate it!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.