I have the following code:
NSString *Items[91];
in the .m file above all the methods to serve as global array which in my init method i do:
for (j1 = 0; j1 <= 90; j1++)
{
Items[j1] = [[NSString alloc] initWithFormat:@""];
}
and at some point a different method AA is triggered and do:
Items[40] = [NSString stringWithFormat:@"40. Pers:%g each", PersExemptions];
Items[41] =@"blah blah";
... etc
and at some point a different method BB is triggered and i see that for Items[40] it says freed object, it's losing the value it had which defeat the purpose. Grr.
I would like Items array to keep their modified values thru the app until the end and I assumed that using the initWithFormat that i used in the init method should take care of it. I understand that Items is c-style array (and to convert to NSMutable array would pain) if that's the problem to begin with.
I appreciate any help on this.