I am obj c n00b so forgive me if this is a dumb question, but my app is crashing when this JSON call is happening and it wasn’t before. I am 95% positive it has something to do with the php call on the server. Would love any thoughts on this. 🙂
Thanks!
Here is where it breaks…
else if([ret_st hasPrefix:@"Account veri"]){
NSMutableArray *Array=[ret_st componentsSeparatedByString:@"_"];
appDelegate.user_id=[Array objectAtIndex:1];
NSLog(@”user_id %@”,appDelegate.user_id);
2012-04-07 09:43:51.094 App[57919:15e03] request requestType=signup&name=Test&email=test@test.com&password=test&zip=90084&id=22 return_strr Account verified204
2012-04-07 09:43:51.094 App[57919:15e03] * Terminating app due to uncaught exception ‘NSRangeException’, reason: ‘* -[__NSArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]’
* First throw call stack:
(0x1a23022 0x1e0ccd6 0x1a0f644 0xdb5d 0x10a85d 0x19f7936 0x19f73d7 0x195a790 0x1959d84 0x1959c9b 0x230d7d8 0x230d88a 0x442626 0x279d 0x2065)
terminate called throwing an exception
Somewhere you have an array with one object in it at index 0 (bounds [0 .. 0]) but you are asking for an object at index 1 (index 1 beyond bounds). Check your code for
objectAtIndex:calls.