NSRangeException on iPod but not on iPad or iPhone Simulator
NSRangeException on iPod but not on iPad or iPhone Simulator
- Subject: NSRangeException on iPod but not on iPad or iPhone Simulator
- From: Philip McIntosh <email@hidden>
- Date: Tue, 06 Dec 2011 21:01:13 -0700
I have an iPad app that I converted to ARC (Snow Leopard, XCode 4.2) that does some calculator functions and got it accepted at the store. Now I am making an iPhone/iPod version and after a few relatively small changes to the interface it works exactly like the iPad app in the simulator. However when I load in on an armv6 iPod it works mostly perfectly except when I try to divide by zero (or try to operate on numbers that do not have legal decimal point formatting). The exact same code in the iPad version, and also running it with the simulator, handles the exceptions (I'm using NSDecimalNumber) and displays an error message and gives a sound. But on the iPod, I get the sound and then it crashes with an uncaught NSRangeException with [NSArray objectAtIndex:]: index 1 beyond bounds [0 .. 0]'.
Now, I do have some arrays used in methods that check to see if the last numerical entry was a zero and also to see if there are any decimal points in the number and to see if there is more than one decimal point. I have used NSLogging to report the decimal counts and if I enter three decimal points (which would be detected as illegal) it properly counts them. So the array accesses do not seem to be out of range when the elements are counted. Perhaps there are some other arrays used by the system that I do not explicitly know about that get out of range, but it drives me mad that it works on the iPad (armv7) and in the simulator but not on the armv6 iPod. It does not make any difference which compiler I use, LLVM or GCC. My best clue is that it seems to be related to running it on an armv6 device.
I am leaning toward rewriting the app to not use ARC and try again. Is there a chance this might work, or are there any suggestions for how can I more effectively track down this uncaught exception? Thanks so much. |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden