Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 7    Views: 76

Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
06/03/13 10:37 AM (12 years ago)

NAD Quiz Not Running

Hi All, I am trying to use the NAD Quiz, and am having some problems. App compiles fine however, freezes upon launching. NS Log: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2013-06-03 10:34:16.457 appName[10345:c07] NAD_advanced_quiz: B 2013-06-03 10:34:16.457 appName[10345:c07] NAD_advanced_quiz: called updateViewConstraints 2013-06-03 10:34:16.459 appName[10345:c07] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Unable to install constraint on view. Does the constraint reference something from outside the subtree of the view? That's illegal. constraint:<NSLayoutConstraint:0xb5739c0 UILabel:0xb56f6d0.centerX == UIView:0xb56df50.centerX> view:<UIView: 0xb56ca00; frame = (0 0; 320 416); autoresize = W+H; layer = <CALayer: 0xb56caf0>>' *** First throw call stack: (0x3761012 0x355ae7e 0x3760deb 0x198a4a0 0x215b83e 0x215ba27 0x215bb76 0x215bd3b 0x215bc4d 0x155f7d 0x145feb 0x14b82f 0x14ad07 0x146b55 0x17d55b3 0x3720376 0x371fe06 0x3707a82 0x3706f44 0x3706e1b 0x3ae07e3 0x3ae0668 0x1c21ffc 0x4aa26 0x2bd5) libc++abi.dylib: terminate called throwing an exception (lldb) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Thanks, Jake
 
trouty
I hate code!
Profile
Posts: 338
Reg: Mar 26, 2013
London Outskirt...
4,830
like
06/03/13 10:48 AM (12 years ago)
Is there an image in the first question? Is the location of the image and its size correct? I'd remove the first question and see how the rest runs
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
06/03/13 10:52 AM (12 years ago)
Thanks for your reply. This only occurs when I leave the "Question Text" blank and only want to show an image. How do I only show an image, no question text? Jake
 
trouty
I hate code!
Profile
Posts: 338
Reg: Mar 26, 2013
London Outskirt...
4,830
like
06/03/13 11:00 AM (12 years ago)
Don't know, I don't have that plugin
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
06/03/13 11:54 AM (12 years ago)
Is the include image check box checked?
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
06/03/13 12:03 PM (12 years ago)
I was able to recreate this error. Working on it.
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
06/03/13 12:18 PM (12 years ago)
I think I got it. Line 2728-2738 looks like this constraint = [NSLayoutConstraint constraintWithItem:_qOuterLabel attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:_questionView attribute:NSLayoutAttributeCenterX multiplier:1.0f constant:0.0f]; [self.view addConstraint:constraint]; Your going to want to wrap this code in an if statement: like so: if(_qOuterLabel.superview != nil){ constraint = [NSLayoutConstraint constraintWithItem:_qOuterLabel attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:_questionView attribute:NSLayoutAttributeCenterX multiplier:1.0f constant:0.0f]; [self.view addConstraint:constraint]; }
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
06/03/13 02:10 PM (12 years ago)
Nice job, Nad :) Cheers! -- Smug
 

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.