I am developing a quiz app. I take questions from a xml file, parse it and display random questions. These are stored in NSdictionary and NSMutableArray. Also the app plays background music and sound for clicking of buttons(AVAudioPlayer). and vibration( AudioServicesPlaySystemSound(kSystemSoundID_Vibrate))
In one particular function if i try to release the temp variables that I use(I.E NSDictionary and NSMutableArray) the app crashes wen i reach that function for the second time. Hence if i don release these, it works fine but eventually crashes with a "EXC_BAD_ACCESS" ERROR. It does not point out to any line or function.
When i used the tool "LEAKS", it showed i was having around 7000 leaks. I don understand how to use that tool but I am sure that i am not creating so many variables, jus a few and even those I release.
And just once i got the ERROR " data formatters temporarily unavailable".
Any Idea what i am doing wrong?? F1 :)
PS: my code is all simple stuff, plus i donno what the problem is hence i donno what code to post here? Also i would like to know if i create a NSString* in a function for temp use should i release it at the end of the function?(i do release it) EDIT:
-(void) loadQuestion
{
strCorrectAnswer = @"";
int intQuestionNo;
NSString *strQuestionNo = [[NSString alloc] init];
// get random question out the xml file
NSDictionary *dctQue = [dctQuestions objectForKey:strQuestionNo];
// blah blah
// jumble the answers to be displaed
NSMutableArray *answerJumble = [[NSMutableArray alloc] init];
NSMutableArray *answers =[NSMutableArray arrayWithObjects:[dctQue objectForKey:@"WrongAnswer1"],[dctQue objectForKey:@"WrongAnswer2"],[dctQue objectForKey:@"WrongAnswer3"],[dctQue objectForKey:@"CorrectAnswer"],nil];
// blah blah
/*
[strQuestionNo release];
[answers release];
[answerJumble release]; */
}