views:

37

answers:

2

Hey guys. I'm having this problem for 2 days now and I really don't know what to do anymore.

When I run the iPhone 4 simulator and click a specific picker, the app crashes with the

error: 'NSRangeException', reason: '* -[NSMutableArray objectAtIndex:]: index 4294967295 beyond bounds [0 .. 3]'

However, it doesn't happen with iPhone 3 simulator.

  • I know that NSNotFound is 2147483647, the longest 32bit int and 4294967295 is the longest uint 32bit but don't know what it has to do with it. -

Plus, if I run it on another user account on my Snow Leopard 10.6.4 it works just fine without giving me that crash and also, my coworker is able to run this app on his machine without having the crash too.

What can be wrong in my user account? I tried deleting the .pbxuser file form the project and having it recreate the file but without any success.

Does anyone have any ideas about this? Or what I can do on my user account that might fix this?

Thanks.

A: 

Try deleting the app from the simulator and recompiling. It might be user data or defaults causing the issue.

JeremyP
Just did it. Deleted the app and the simulator's contents and settings. Still crashes when I click the picker. I'm pretty sure it's related to my user account. Just don't know what can be the cause or how I can fix it. :/
BeOliveira
Well you have a debugger, you need to step through with it to find out where that bad value is coming from.
JeremyP
Yeah, I tried that too. The debugger shows it running smooth, all my NSLogs and stuff but once I click the picker, I get the NSRangeException and the app is killed immediately with no other traces. Tried using NSZombie and enabling Guard Malloc too but it's not helping.
BeOliveira
A: 

Try deleting if from the simulator, and then cleaning and rebuilding your solution.

Also, have you tried stepping through the solution one piece at a time to see what each object's value is as you go? It looks like something is not being initialized correctly...

Geoff Baum
Tried it with the simulator already. Same thing. My friend made some changes and committed it on subversion, I updated to the newest build and same here. It's working on 3 different iPhone/iPod devices and other computers, but on mine it crashes on the picker.
BeOliveira
Reinstall xcode?
Geoff Baum