Discussion Forums  >  Crashes, Memory Warnings

Replies: 11    Views: 106

jbrzensk
buzztouch Evangelist
Profile
Posts: 56
Reg: Oct 04, 2011
Denver
8,010
03/14/12 07:18 AM (12 years ago)

iPad and Quiz Ending Screen Crash

When testing a quiz on an iPad, anyone ever click off the final menu? Like when it says "Submit score" "Try Again" "Quit", have you clicked somewhere besides that popup? All my quiz apps I find crash when you do this. These are all with iOS 5.1 I am guessing it is somewhere in the UIActionSheet not knowing what to do if the focus is not on it. Any help on a workaround is appreciated
 
Marko
buzztouch Evangelist
Profile
Posts: 558
Reg: May 04, 2011
UK, Alcester
8,880
like
03/14/12 07:37 AM (12 years ago)
I am just checking app before submitting to app store, iphone only, I am not having problem with quiz function up to iOS 5.0, I have to upgrade to lion for that (which I think I am going to have to do) is it happening in 5.0 or below
 
jbrzensk
buzztouch Evangelist
Profile
Posts: 56
Reg: Oct 04, 2011
Denver
8,010
like
03/14/12 07:47 AM (12 years ago)
It only happens on the iPad, checked iOS 5.0 and 5.1, and only the final popup menu.
 
Marko
buzztouch Evangelist
Profile
Posts: 558
Reg: May 04, 2011
UK, Alcester
8,880
like
03/14/12 07:49 AM (12 years ago)
That stumps me, I think its a global conspiracy to get everyone to upgrade to ipad 3's
 
jbrzensk
buzztouch Evangelist
Profile
Posts: 56
Reg: Oct 04, 2011
Denver
8,010
like
03/14/12 08:36 AM (12 years ago)
@Dave maybe check this out. On the iPad, BT_screen_quiz.m, (void)actionSheet was crashing my app because when clicked outside the popup, it generates buttonIndex = -1, which apparently it couldn't handle. First line of (void)actionSheet I added: if (buttonIndex != -1) { Then way down at the bottom: } [self release]; So if buttonIndex not equal to -1, do the regular stuff, but if it does, then just release the view. This lets me click outside the popup without any crashes. Now If it could only do the popup after I click out of game center :) Hope this helps
 
Stefan
buzztouch Evangelist
Profile
Posts: 558
Reg: Dec 21, 2010
Sweden
14,780
like
03/14/12 09:23 AM (12 years ago)
I must look into this. I'm about to send a ipad quiz app for review. Thanks for the heads up on this. Br stefan
 
jbrzensk
buzztouch Evangelist
Profile
Posts: 56
Reg: Oct 04, 2011
Denver
8,010
like
03/14/12 12:36 PM (12 years ago)
If you have Game Center: 1 - Don't put the [self release] at the end of quizEnded 2 - In BT_screen-quiz.m After (void)showScoreboard, add this - (void)leaderboardViewControllerDidFinish:(GKLeaderboardViewController *)viewController { [viewController becomeFirstResponder]; [viewController dismissModalViewControllerAnimated:YES]; [self performSelector:@selector(quizEnded) withObject:nil afterDelay:quizQuestionDelay];//restarts quiz ended menu } If you have achievements, add a similar code after achievements, changing GKLeaderboard to GKAchievement. This solves : Crashing when not clicking on the final menu Not showing menu after exiting Game Center Crashing when picking same Game Center option more than once Crashing when picking final menu option more than once
 
jbrzensk
buzztouch Evangelist
Profile
Posts: 56
Reg: Oct 04, 2011
Denver
8,010
like
03/14/12 01:23 PM (12 years ago)
I was too excited. This should be thing after (void)showScoreboard - (void)achievementViewControllerDidFinish:(GKAchievementViewController *)viewController { NSLog(@"Remove Achievements from Game Center"); //appDelegate cpma_appDelegate *appDelegate = (cpma_appDelegate *)[[UIApplication sharedApplication] delegate]; [viewController dismissModalViewControllerAnimated:YES]; if([appDelegate.rootApp.rootDevice isIPad]){ [self performSelector:@selector(quizEnded) withObject:nil afterDelay:quizQuestionDelay]; NSLog(@"isIpad Reload quizEnded screen"); } } Needed the appDelegate so the quizEnded only reloads itself if on an iPad. No need to do it on a iPhone where it works
 
Stefan
buzztouch Evangelist
Profile
Posts: 558
Reg: Dec 21, 2010
Sweden
14,780
like
03/14/12 02:51 PM (12 years ago)
Yup! Totally crashes on my ipad. The fixes you submitted here fixes this errors or? BR/Stefan
 
jbrzensk
buzztouch Evangelist
Profile
Posts: 56
Reg: Oct 04, 2011
Denver
8,010
like
03/14/12 03:12 PM (12 years ago)
Use the last of my postings. There have been no crashes, no matter what I try. If you don't have Game Center, you just need the first part with if(buttonItem != -1){ } around (void)actionSheet in BT_screen_quiz.m If you have Game center, use the other post, and add those functions after the (void)showLeaderboard, (void)submitScore, (void)showAchievements, or anything else that involves Game center, changing the GKAchievementViewController for the appropriate thing.
 
rdrye2000
Code is Art
Profile
Posts: 24
Reg: Jan 08, 2012
Atlanta
240
like
03/31/12 06:12 PM (12 years ago)
Subscribing to Thread
 
Marko
buzztouch Evangelist
Profile
Posts: 558
Reg: May 04, 2011
UK, Alcester
8,880
like
03/31/12 06:19 PM (12 years ago)
Dear rdrye2000 I love the greed is good pic thing but the message - subscribing to thread does not help me in any way whatsoever, its like some Greek banker on a yacht saying he thinks the economy may be a bit of a challenge. PS in the day I had one of those phones I looked such a plonker, but not as bad as a teenager I seen riding a bike while using an ipad!
 

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.