I thought I would run this by everybody, it is driving me nuts. This shouldn't be so hard, but I feel like I'm missing something simple: Here is my code:
//temp array to hold file paths
NSMutableArray *slideShowFilesTemp = [NSMutableArray arrayWithCapacity:200];
// (I have tried to initialize slideShowFilesTemp this way too)
//NSMutableArray *slideShowFilesTemp;
//slideShowFilesTemp = [[NSMutableArray alloc] init];
//Audioclip file name
NSString *recorderFilePath;
recorderFilePath = [[NSString stringWithFormat:@"%@/%@.caf", DOCUMENTS_FOLDER, questionCorrectAnswerAudioFileName] retain];
//get image path
NSString *imageSelectionName;
imageSelectionName = [sentenceArray objectAtIndex:imageLocationPointer];
NSBundle *bundle3 = [NSBundle mainBundle];
NSString *imagePath1 = [bundle3 pathForResource

@"%@", imageSelectionName) ofType:@"png"];
[slideShowFilesTemp addObject:recorderFilePath];
[slideShowFilesTemp addObject:imagePath1];
[self.slideShowFiles addObjectsFromArray:slideShowFilesTemp];
slideShowFiles is a mutable array and has accessor methods. What I am trying to do is keep track of the recorded filepath and the associated image and put them into a MutableArray for access later. This code is in a -IBAction routine that is run when you hit a button.
If I look at what goes into slideShowFilesTemp, it is exactly as I want it. However, when I do a NSLog of the slideShowFiles Mutable array, it comes back as a nil.
If I use the following code: "self.slideShowFiles = slideShowFilesTemp;", then slideShowFiles has exactly the same objects as slideShowFilesTemp, however it just overwrites whatever was in slideShowFiles (as I would expect). I want to add what it in slideShowFilesTemp to the back of slideShowFiles.
Am I not initializing slideShowFilesTemp correctly? I have tried it two ways as shown above. Any suggestions or pointers would be appreciated.
Kyle