Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 04-13-2009, 02:53 PM   #1 (permalink)
m0s
Registered Member
 
Join Date: Mar 2009
Posts: 122
Exclamation 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.
m0s is offline   Reply With Quote
Old 04-13-2009, 02:57 PM   #2 (permalink)
m0s
Registered Member
 
Join Date: Mar 2009
Posts: 122
Default

ha ha fixed it.
m0s is offline   Reply With Quote
Old 04-13-2009, 03:03 PM   #3 (permalink)
Registered Member
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,534
Send a message via ICQ to smithdale87 Send a message via AIM to smithdale87 Send a message via Skype™ to smithdale87
Default

what turned out to be the problem??
smithdale87 is offline   Reply With Quote
Old 04-13-2009, 03:04 PM   #4 (permalink)
Pro. Game Developer
iPhone Dev SDK Supporter
 
Join Date: Feb 2009
Location: żLa Islas Hermosas?
Posts: 2,178
Default

Quote:
Originally Posted by m0s View Post
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.
Kalimba is offline   Reply With Quote
Old 04-13-2009, 03:14 PM   #5 (permalink)
m0s
Registered Member
 
Join Date: Mar 2009
Posts: 122
Default

Quote:
Originally Posted by smithdale87 View Post
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 View Post
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.
m0s is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 157,871
Threads: 88,917
Posts: 379,300
Top Poster: BrianSlick (7,072)
Welcome to our newest member, globaltrash2
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:28 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0