How to clear a dictionary?

4thSpace picture 4thSpace · Dec 31, 2009 · Viewed 27.5k times · Source

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?