Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.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, 01:53 PM   #1 (permalink)
m0s
New Member
 
Join Date: Mar 2009
Posts: 77
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 02:00 PM.
m0s is offline   Reply With Quote
Old 04-13-2009, 01:57 PM   #2 (permalink)
m0s
New Member
 
Join Date: Mar 2009
Posts: 77
Default

ha ha fixed it.
m0s is offline   Reply With Quote
Old 04-13-2009, 02:03 PM   #3 (permalink)
Magic Hands' Daddy
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 22
Posts: 1,372
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??
__________________
Games
AppRoach - (v1.0)
7 Deaths In Nagamachi (v1.1)
Segment (v1.2)
ThumStruck Free (v1.5)
Plummet - new (v1.0)
ThumStruck 2! - Coming Soon

Apps
ArtsMemphis - (v1.0)
Elvis Mobile (v1.1)
DataLoss DB - (v1.1)
Lovers & Haters - (v1.0)
smithdale87 is offline   Reply With Quote
Old 04-13-2009, 02:04 PM   #4 (permalink)
Pro. Game Developer
iPhone Dev SDK Supporter
 
Join Date: Feb 2009
Location: żLa Islas Hermosas?
Posts: 1,426
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, 02:14 PM   #5 (permalink)
m0s
New Member
 
Join Date: Mar 2009
Posts: 77
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 02: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


Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,264
Threads: 39,063
Posts: 171,297
Top Poster: smasher (2,575)
Welcome to our newest member, jessejames
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:49 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0