NSString won't add itself to NSMutableArray

johnnyboy19

New Member
I'm trying to add an NSString to an NSMutableArray (which will hold only NSStrings). I'm not getting any errors, but when I query the array's \[code\]count\[/code\], it returns zero, indicating that it didn't add the value. Here's my code (its getting some XML, which is definitely 100% working):\[code\]// get an array of genres for this gameNSArray *genreList = [self getAllItems:mad:"//genre" fileName:[NSURL URLWithString:queryURL]];int numberOfGenres = [genreList count];NSLog(@"This game has %u genres", numberOfGenres);\[/code\]This NSLog reports correctly, the number of entries in the XML result, usually between 1-5.\[code\]// put the genre names from that array into the current game's objectif (numberOfGenres > 0) { for (int i = 0; i < numberOfGenres; i++) { NSString *currentGenreName = [NSString stringWithString:[[genreList objectAtIndex:i] objectForKey:mad:"name"]]; [currentGame.gameGenres addObject: currentGenreName]; NSLog(@"I added a genre to %@, called %@.", currentGame.gameName, currentGenreName); }}\[/code\]This NSLog also reports correctly, with the game's title, and the of that in the XML tree.\[code\]// save current game to game listNSLog(@"I'm about to save %@ to the array, with its %u genres", currentGame.gameName, [currentGame.gameGenres count]);[_listOfGamesReturnedFromSearch addObject:currentGame];\[/code\]This last NSLog always reports the number of genres as zero. If I query the \[code\]_listOfGamesReturnedFromSearch\[/code\] array later, it saved the other properties fine (name), but the genres count is zero
 
Top