 |
 |
|
 |
04-13-2009, 02:53 PM
|
#1 (permalink)
|
|
New Member
Join Date: Mar 2009
Posts: 77
|
TERMIN ... UNDUE EXCEPTION ... ??
OK.
So randomly while coding I get a crash and 'terminating due to uncaught exception', and I have no idea really what happened as I was just doing some tweaking.
Basically what I thought I would do is that I regularly zip up my development directory incrementally so that I can back track through the development process should disaster occur.
Fortunately I had backed up a day ago, and I had only been working on a small part of code, so I thought I would copy/paste the new code into textedit, then delete the contents of my current project directory and reinstate it from the zip file I made a day ago.
But this old project, which had been working on just fine until 20 minutes ago, and certainly was not crashing when I zipped it up yesterday is ALSO crashing with an uncaught exception.
Advice Please - Thanks.
here is the exception
Code:
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray objectAtIndex:]: index (1) beyond bounds (1)'
Last edited by m0s; 04-13-2009 at 03:00 PM.
|
|
|
04-13-2009, 02:57 PM
|
#2 (permalink)
|
|
New Member
Join Date: Mar 2009
Posts: 77
|
ha ha fixed it.
|
|
|
04-13-2009, 03:03 PM
|
#3 (permalink)
|
|
Magic Hands' Daddy
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 22
Posts: 1,245
|
what turned out to be the problem??
|
|
|
04-13-2009, 03:04 PM
|
#4 (permalink)
|
|
Pro. Game Developer
iPhone Dev SDK Supporter
Join Date: Feb 2009
Location: żLa Islas Hermosas?
Posts: 1,260
|
Quote:
Originally Posted by m0s
Code:
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray objectAtIndex:]: index (1) beyond bounds (1)'
|
The exception message is telling you right there what the problem is. You're indexing an array with index of 1, but the array only contains one object. Run it in the debugger to find out exactly where this is happening.
|
|
|
04-13-2009, 03:14 PM
|
#5 (permalink)
|
|
New Member
Join Date: Mar 2009
Posts: 77
|
Quote:
Originally Posted by smithdale87
what turned out to be the problem??
|
By "fixed it" I meant "oops I broke it" and reset the simulator.
Quote:
Originally Posted by Kalimba
The exception message is telling you right there what the problem is. You're indexing an array with index of 1, but the array only contains one object. Run it in the debugger to find out exactly where this is happening.
|
Right, not so sure but I think it is to do with my Picker, I was being a little heavy handed with it so I think the picker might have been out of bounds(?). I am saving the picker position in NSUserDefaults so that on next boot the app goes to the last position the picker was in.
The only time I could recall there being an ObjectatIndex call in my code was to do with the picker, so I figured it was a problem during the reset to previous at boot. So I figured resetting the Simulator -> Losing the NSUserdefaults would fix it.
I realize this isn't a long term solution, and it's actually good to have found the bug now rather than later, but I am just glad it is working again.
I have heard about and experienced some odd behavior from pickers, with individual picker entries occasionally dropping out. Not sure what causes it, or if anyone here has experienced it.
Last edited by m0s; 04-13-2009 at 03:19 PM.
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
» Advertisements |
» Online Users: 476 |
| 38 members and 438 guests |
| acegames, Akshay Shah, baxtercr, beginer2007, danny8, dennis3484, eyefone, fede, gabacus, harikant_jammi, hawksz, hc98br, ianian, Iphonica, jackson, jdavid, joelm, kikesantos, kilobytedump, m4r0ck, mcwhite, mgales, mobilesoftware, Mr Jack, mxstudios, raees, raziiq, refreshe, riq, robertyang999, scalar, shweta13, supudo, theM, tin pot, wolfenberg |
| Most users ever online was 779, 05-11-2009 at 10:55 AM. |
» Stats |
Members: 21,478
Threads: 35,762
Posts: 156,660
Top Poster: smasher (2,448)
|
| Welcome to our newest member, m4r0ck |
|