aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authormltownsend <mltownsend@gmail.com>2008-12-17 22:32:09 +0000
committermltownsend <mltownsend@gmail.com>2008-12-17 22:32:09 +0000
commit906c1bda101a07181185d8dc6da412d1a6eb7c3d (patch)
tree2fc8ab7bcd9cec2028be7c296c372f7e708470e4 /Source
parent3715748cb2e339b8a4afe9c7c9e5ae89560812d8 (diff)
downloadsequelpro-906c1bda101a07181185d8dc6da412d1a6eb7c3d.tar.gz
sequelpro-906c1bda101a07181185d8dc6da412d1a6eb7c3d.tar.bz2
sequelpro-906c1bda101a07181185d8dc6da412d1a6eb7c3d.zip
Mutating a NSMutableDictionary while enumerating through it.
Diffstat (limited to 'Source')
-rw-r--r--Source/TableSource.m7
1 files changed, 4 insertions, 3 deletions
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];
}