I have an app i building which is a simple naviagtion app. I do not want to load the data from my xml multiple times so I am using a singleton to load and hold the data. My first table pushes the view of the second table. This table calls the singleton and the get the array of data from there to display in the table.
This all works fine, I click on a cell in the first table which takes me to the second table where the singleton is used. I navigate back to the the first table, then back to the second table, this is when i get the EXC_BAD_ACCESS error. It doesn't error when i init the singleton but when I try and access the array in it. The code is as follows
MediaData *dataClass = [MediaData sharedManager];
//when i check in the singleton the second time sharedManager is already there
sortedData = dataClass.arrMediaData; //this line errors the second time
NSLog(@"sorted array. %@", sortedData);
[dataClass release];
Any help would be great as it is not a very descriptive error, thanks