From 906c1bda101a07181185d8dc6da412d1a6eb7c3d Mon Sep 17 00:00:00 2001 From: mltownsend Date: Wed, 17 Dec 2008 22:32:09 +0000 Subject: Mutating a NSMutableDictionary while enumerating through it. --- Source/TableSource.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Source') diff --git a/Source/TableSource.m b/Source/TableSource.m index 58c5fb34..3c91f76c 100644 --- a/Source/TableSource.m +++ b/Source/TableSource.m @@ -518,7 +518,7 @@ fetches the result as an array with a dictionary for each row in it { NSMutableArray *tempResult = [NSMutableArray array]; NSMutableDictionary *tempRow; - NSEnumerator *enumerator; + NSArray *keys; id key; int i; @@ -527,8 +527,9 @@ fetches the result as an array with a dictionary for each row in it tempRow = [NSMutableDictionary dictionaryWithDictionary:[theResult fetchRowAsDictionary]]; //use NULL string from preferences instead of the NSNull oject returned by the framework - enumerator = [tempRow keyEnumerator]; - while ( (key = [enumerator nextObject]) ) { + keys = [tempRow allKeys]; + for (int i = 0; i < [keys count] ; i++) { + key = [keys objectAtIndex:i]; if ( [[tempRow objectForKey:key] isMemberOfClass:[NSNull class]] ) [tempRow setObject:[prefs objectForKey:@"nullValue"] forKey:key]; } -- cgit v1.2.3