/ Published in: Objective C
Just a simple loop around a mutable dictionary object which I always seem to forget.
Expand |
Embed | Plain Text
for (id theKey in aDictionary) { id anObject = [[aDictionary objectForKey:theKey] retain]; }
Comments
Subscribe to comments
You need to login to post a comment.

just what i need!
You realize that anObject in the code above has to be released? So technically an example above has a memory leak...
If anObject is used within the scope of 'for', it's better not to use 'retain'
Thanks dc_2000. Its assuming that you do something with anObject and then release it after the fact but I suppose that wasn't clear :)