I used -[NSDictionary getObjects:andKeys:] method first time, and I discovered there’s no policy on description should I free the memory or not. I think * Returns by reference C arrays* means it’s just a reference to internal memory block, so I shouldn’t free them, but it is not sure. Should I free them?
And I think there’re some conventions about this. What are the convention or where can I find the conventions or rules about C memory management on Objective-C/Cocoa? (of course, I know Objective-C level conventions but I mean case of using C-level objects)
You do not release the objects or keys. They will be released when the dictionary is released. While this call may be useful in some situations, in general I would try sticking to other methods if you want to iterate all of the items in a dictionary, such as -enumerateKeysAndObjectsUsingBlock or -allKeys.