I'm currently doing the following to clear out an NSMutableDictionary
[myDictionary release];
myDictionary = [[NSMutableDictionary alloc] init];
The release line doesn't actually release any objects in the dictionary. I can still see all of them on the next line. It isn't until the alloc line is executed that the dictionary is zeroed out. Is there a better way to do it?
I can't test it at the moment, but have you tried the removeAllObjects
method of NSMutableDictionary
?