Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 20    Views: 108

eespverbatim
buzztouch Evangelist
Profile
Posts: 106
Reg: Feb 14, 2012
London
5,160
07/30/14 12:12 PM (9 years ago)

Advanced Quiz Crashing on iPad

I've noticed some other instances of this on the forum, but can't see a solution. The Advanced Quiz plugin continually crashes out on iPad when it should go the finished screen. Anyone know of the fix?
 
Ed Goodall
Fusion Technology
Profile
Posts: 422
Reg: Oct 01, 2011
Wiltshire, UK
12,320
like
07/30/14 12:16 PM (9 years ago)
If you run it on the simulator, do you get the same error? If so, is anything printed to the NSLog? Thanks Ed
 
eespverbatim
buzztouch Evangelist
Profile
Posts: 106
Reg: Feb 14, 2012
London
5,160
like
07/30/14 12:26 PM (9 years ago)
I get it on the sim as well: 2014-07-30 20:17:00.466 redbeardacdc[3388:60b] NAD_advanced_quiz: selected ^ 2014-07-30 20:17:00.466 redbeardacdc[3388:60b] NAD_advanced_quiz: answer is WRONG 2014-07-30 20:17:00.466 redbeardacdc[3388:60b] NAD_advanced_quiz: 3 2014-07-30 20:17:02.169 redbeardacdc[3388:60b] NAD_advanced_quiz: set questions and awnsers. 2014-07-30 20:17:02.229 redbeardacdc[3388:60b] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 39 beyond bounds [0 .. 38]' *** First throw call stack: ( 0 CoreFoundation 0x03e531e4 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x037518e5 objc_exception_throw + 44 2 CoreFoundation 0x03df43f6 -[__NSArrayM objectAtIndex:] + 246 3 redbeardacdc 0x00096a7a -[NAD_advanced_quiz setQuestionsAndAnswers] + 426 4 redbeardacdc 0x000a5224 __39-[NAD_advanced_quiz transitionQuestion]_block_invoke648 + 68 5 UIKit 0x0238e435 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 306 6 UIKit 0x023776dc -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 267 7 UIKit 0x023779c8 -[UIViewAnimationState animationDidStop:finished:] + 80 8 QuartzCore 0x004d1bb4 _ZN2CA5Layer23run_animation_callbacksEPv + 304 9 libdispatch.dylib 0x065f24d0 _dispatch_client_callout + 14 10 libdispatch.dylib 0x065e0726 _dispatch_main_queue_callback_4CF + 340 11 CoreFoundation 0x03eb843e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14 12 CoreFoundation 0x03df95cb __CFRunLoopRun + 1963 13 CoreFoundation 0x03df89d3 CFRunLoopRunSpecific + 467 14 CoreFoundation 0x03df87eb CFRunLoopRunInMode + 123 15 GraphicsServices 0x040b45ee GSEventRunModal + 192 16 GraphicsServices 0x040b442b GSEventRun + 104 17 UIKit 0x02327f9b UIApplicationMain + 1225 18 redbeardacdc 0x0004a886 main + 86 19 libdyld.dylib 0x06827701 start + 1 20 ??? 0x00000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)
 
Ed Goodall
Fusion Technology
Profile
Posts: 422
Reg: Oct 01, 2011
Wiltshire, UK
12,320
like
07/30/14 12:27 PM (9 years ago)
Is this just out-of-the-box? Or have you changed some code? Ed
 
Ed Goodall
Fusion Technology
Profile
Posts: 422
Reg: Oct 01, 2011
Wiltshire, UK
12,320
like
07/30/14 12:28 PM (9 years ago)
2 Things to Check... Deployment Target is iOS 6.0 or Higher GameKit.Framework is included in your Build Binaries Can you confirm you have done this please Thanks Ed
 
eespverbatim
buzztouch Evangelist
Profile
Posts: 106
Reg: Feb 14, 2012
London
5,160
like
07/30/14 12:29 PM (9 years ago)
Haven't tampered with the Quiz code at all, but have made some modifications to the app as a whole, main one being force to landscape.
 
eespverbatim
buzztouch Evangelist
Profile
Posts: 106
Reg: Feb 14, 2012
London
5,160
like
07/30/14 12:30 PM (9 years ago)
Deployment is 6.0.... will check on framework now
 
Ed Goodall
Fusion Technology
Profile
Posts: 422
Reg: Oct 01, 2011
Wiltshire, UK
12,320
like
07/30/14 12:30 PM (9 years ago)
Ok, check the above for me. Thanks Ed
 
eespverbatim
buzztouch Evangelist
Profile
Posts: 106
Reg: Feb 14, 2012
London
5,160
like
07/30/14 12:39 PM (9 years ago)
Thanks for this help Ed. Gamekit is there. A bit more from the output: "<NSAutoresizingMaskLayoutConstraint:0xde9ebb0 h=-&- v=-&- UIViewControllerWrapperView:0xea7e470.width == UINavigationTransitionView:0xec5b190.width>", "<NSAutoresizingMaskLayoutConstraint:0xdea98e0 h=-&- v=-&- UINavigationTransitionView:0xec5b190.width == UILayoutContainerView:0xec58950.width>", "<NSLayoutConstraint:0xdeaaad0 'UIView-Encapsulated-Layout-Width' H:[UILayoutContainerView:0xec58950(1024)]>", "<NSAutoresizingMaskLayoutConstraint:0x1234cd40 h=-&- v=-&- UIView:0x12074110.width == UIViewControllerWrapperView:0xea7e470.width>", "<NSLayoutConstraint:0xef3c190 H:[UIView:0x1207c6f0(980)]>", "<NSLayoutConstraint:0xef46da0 UIView:0x1207c6f0.centerX == UIScrollView:0x1203ea00.centerX>", "<NSLayoutConstraint:0xef47030 H:|-(0)-[UIScrollView:0x1203ea00] (Names: '|':UIView:0x12074110 )>", "<NSLayoutConstraint:0xef46330 H:|-(NSSpace(20))-[UIView:0x1207c6f0] (Names: '|':UIScrollView:0x1203ea00 )>", "<NSLayoutConstraint:0xef47080 H:[UIScrollView:0x1203ea00]-(0)-| (Names: '|':UIView:0x12074110 )>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0xef46da0 UIView:0x1207c6f0.centerX == UIScrollView:0x1203ea00.centerX> Break on objc_exception_throw to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful. 2014-07-30 20:30:46.357 redbeardacdc[3500:60b] NAD_advanced_quiz: answer click 2014-07-30 20:30:46.358 redbeardacdc[3500:60b] NAD_advanced_quiz: Chequers 2014-07-30 20:30:46.358 redbeardacdc[3500:60b] NAD_advanced_quiz: correct ^ 2014-07-30 20:30:46.358 redbeardacdc[3500:60b] NAD_advanced_quiz: Chequers 2014-07-30 20:30:46.358 redbeardacdc[3500:60b] NAD_advanced_quiz: selected ^ 2014-07-30 20:30:46.359 redbeardacdc[3500:60b] NAD_advanced_quiz: answer is correct 2014-07-30 20:30:48.061 redbeardacdc[3500:60b] NAD_advanced_quiz: set questions and awnsers. 2014-07-30 20:30:48.063 redbeardacdc[3500:60b] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 39 beyond bounds [0 .. 38]' *** First throw call stack: ( 0 CoreFoundation 0x03e581e4 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x037568e5 objc_exception_throw + 44 2 CoreFoundation 0x03df93f6 -[__NSArrayM objectAtIndex:] + 246 3 redbeardacdc 0x0009707a -[NAD_advanced_quiz setQuestionsAndAnswers] + 426 4 redbeardacdc 0x000a5824 __39-[NAD_advanced_quiz transitionQuestion]_block_invoke648 + 68 5 UIKit 0x02393435 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 306 6 UIKit 0x0237c6dc -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 267 7 UIKit 0x0237c9c8 -[UIViewAnimationState animationDidStop:finished:] + 80 8 QuartzCore 0x004d6bb4 _ZN2CA5Layer23run_animation_callbacksEPv + 304 9 libdispatch.dylib 0x04e884d0 _dispatch_client_callout + 14 10 libdispatch.dylib 0x04e76726 _dispatch_main_queue_callback_4CF + 340 11 CoreFoundation 0x03ebd43e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14 12 CoreFoundation 0x03dfe5cb __CFRunLoopRun + 1963 13 CoreFoundation 0x03dfd9d3 CFRunLoopRunSpecific + 467 14 CoreFoundation 0x03dfd7eb CFRunLoopRunInMode + 123 15 GraphicsServices 0x049075ee GSEventRunModal + 192 16 GraphicsServices 0x0490742b GSEventRun + 104 17 UIKit 0x0232cf9b UIApplicationMain + 1225 18 redbeardacdc 0x0004ae86 main + 86 19 libdyld.dylib 0x050bd701 start + 1 20 ??? 0x00000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)
 
Ed Goodall
Fusion Technology
Profile
Posts: 422
Reg: Oct 01, 2011
Wiltshire, UK
12,320
like
07/30/14 12:44 PM (9 years ago)
Ok, let me take a look and I'll get back to you
 
Ed Goodall
Fusion Technology
Profile
Posts: 422
Reg: Oct 01, 2011
Wiltshire, UK
12,320
like
07/30/14 12:44 PM (9 years ago)
Can you try stopping the project, cleaning and then re-running? Thanks Ed
 
eespverbatim
buzztouch Evangelist
Profile
Posts: 106
Reg: Feb 14, 2012
London
5,160
like
07/30/14 12:52 PM (9 years ago)
Have cleaned, re-set sim, re-tried. Also have run on hardware as well. Have re-downloaded and re-dragged plugin to xcode..everything I can think of. Still same issue - aaaarrrgggh
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/30/14 12:52 PM (9 years ago)
A bit of debugging the app crashed due to an exception, i.e. the last line of the log libc++abi.dylib: terminating with uncaught exception of type NSException The exception is written just above the *** First throw call stack 2014-07-30 20:30:48.063 redbeardacdc[3500:60b] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 39 beyond bounds [0 .. 38]' The reason it crashed is because the app is looking for the 40th object (0 is counted as 1st) of an array that only has 39 objects in it [__NSArrayM objectAtIndex:]: index 39 beyond bounds [0 .. 38]' Now I'm guessing your quiz has 39 questions and it picks 10 randomly or something like that. So the app would only crash when it is looking for this non existent 40th question. A common reason for this is that the random number generator uses the count of an array without removing one, or making it loop to less than the count in an if statement. I don't own this plugin so can't trawl through the code for you, but Nad should pick this up in the thread soon he's an awesome guy.
 
Ed Goodall
Fusion Technology
Profile
Posts: 422
Reg: Oct 01, 2011
Wiltshire, UK
12,320
like
07/30/14 12:54 PM (9 years ago)
I'm with Kittsy here, if it is still not working and you've done what the instructions say, just wait for the developer. I'm surprised Nad hasn't commented yet, but he will soon! Thanks, sorry I couldn't sort it Ed
 
eespverbatim
buzztouch Evangelist
Profile
Posts: 106
Reg: Feb 14, 2012
London
5,160
like
07/30/14 12:55 PM (9 years ago)
Kittsy - I think you're absolutely right. I'm sure that I do have 40qs, but will check now. Seems obvious when you point it out, in my blind fog of frustration have missed it.
 
eespverbatim
buzztouch Evangelist
Profile
Posts: 106
Reg: Feb 14, 2012
London
5,160
like
07/30/14 01:07 PM (9 years ago)
My control panel was showing only 39 questions, one of the childs must have failed to save. So I slapped myself in the head, added it back in and resumed. BUT, that hasn't taken care of the problem. Cleaned and saved and rebuilt, but same issue. Break on objc_exception_throw to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful. 2014-07-30 20:59:37.993 redbeardacdc[4100:60b] NAD_advanced_quiz: answer click 2014-07-30 20:59:37.993 redbeardacdc[4100:60b] NAD_advanced_quiz: The Gobi Desert Canoe Club 2014-07-30 20:59:37.993 redbeardacdc[4100:60b] NAD_advanced_quiz: correct ^ 2014-07-30 20:59:37.994 redbeardacdc[4100:60b] NAD_advanced_quiz: The Jasper Hart Band 2014-07-30 20:59:37.994 redbeardacdc[4100:60b] NAD_advanced_quiz: selected ^ 2014-07-30 20:59:37.994 redbeardacdc[4100:60b] NAD_advanced_quiz: answer is WRONG 2014-07-30 20:59:37.994 redbeardacdc[4100:60b] NAD_advanced_quiz: 3 2014-07-30 20:59:39.697 redbeardacdc[4100:60b] NAD_advanced_quiz: set questions and awnsers. 2014-07-30 20:59:39.699 redbeardacdc[4100:60b] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 39 beyond bounds [0 .. 38]' *** First throw call stack: ( 0 CoreFoundation 0x03e431e4 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x037418e5 objc_exception_throw + 44 2 CoreFoundation 0x03de43f6 -[__NSArrayM objectAtIndex:] + 246 3 redbeardacdc 0x0009062a -[NAD_advanced_quiz setQuestionsAndAnswers] + 426 4 redbeardacdc 0x0009282f __39-[NAD_advanced_quiz transitionQuestion]_block_invoke581 + 95 5 UIKit 0x0237e435 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 306 6 UIKit 0x023676dc -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 267 7 UIKit 0x023679c8 -[UIViewAnimationState animationDidStop:finished:] + 80 8 QuartzCore 0x004c1bb4 _ZN2CA5Layer23run_animation_callbacksEPv + 304 9 libdispatch.dylib 0x04e734d0 _dispatch_client_callout + 14 10 libdispatch.dylib 0x04e61726 _dispatch_main_queue_callback_4CF + 340 11 CoreFoundation 0x03ea843e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14 12 CoreFoundation 0x03de95cb __CFRunLoopRun + 1963 13 CoreFoundation 0x03de89d3 CFRunLoopRunSpecific + 467 14 CoreFoundation 0x03de87eb CFRunLoopRunInMode + 123 15 GraphicsServices 0x048f25ee GSEventRunModal + 192 16 GraphicsServices 0x048f242b GSEventRun + 104 17 UIKit 0x02317f9b UIApplicationMain + 1225 18 redbeardacdc 0x0004b176 main + 86 19 libdyld.dylib 0x050a8701 start + 1 20 ??? 0x00000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/30/14 01:14 PM (9 years ago)
Does a break line appear in the .m
 
eespverbatim
buzztouch Evangelist
Profile
Posts: 106
Reg: Feb 14, 2012
London
5,160
like
07/30/14 01:16 PM (9 years ago)
Guys, I have it. Updated my config.txt (which I'd already done), cleaned, rebuilt and refreshed about a dozen times and finally it works. The initial error was caused by a non-saved question. Sorry for wasting your time and thanks as always for your generosity. I need to submit within the hour, and in my panic had entered moron zone, where I didn't initially notice the missing q.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/30/14 01:17 PM (9 years ago)
is it when you answer the last question
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/30/14 01:17 PM (9 years ago)
good stuff
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
07/30/14 06:30 PM (9 years ago)
Hey Glad to hear you got it fixed. Been sleeping all day. Working night shift right now. I have a pretty good idea of how to make it so this doesn't happen again. I'll see if I can't post an update. v/r Nick D
 

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.