View Single Post
mattpb99

 
Member Since: Sep 13, 2009
Posts: 2
mattpb99 is on a distinguished road

mattpb99 is offline
The order you declare variables in your .h file may be the problem. in a project I was working on today I found that
Code:
double var_price[17];
NSString *var_name[17];
int var_stock[17];
NSString *var_itemcode[17];
int var_maxstock[17];
int var_arrayno;
returned the EXC_BAD_ACCESS error but after changing the order of things the error went away.
Code:
NSString *var_name[17];
NSString *var_itemcode[17];
double var_price[17];
int var_stock[17];
int var_maxstock[17];
int var_arrayno;
I have no idea why reordering things fixed the problem and it took me hours to find it in the project. The idea "hmm, maybe the variables are declared in the wrong order in the header file" isn't the first thought that came to mind and theoretically I would not think it would make a difference but you can't argue with results
QUOTE Thanks