Rob, You sent me the script above which I have used to get some dates. Researching it further, in Objective-C, every time you alloc() something you have to dealloc() So I used in my code
--- current application's class "NSDateFormatter"'s dealloc() ---
It compiles and run with no problem. So, I am not sure, but being cautious apparently does not cause any problem.
Deivy Petrescu
Hey Rob,
You should never call dealloc except when calling [super dealloc] in a dealloc method. Instead you will call release on the object that needs freeing.
What you are doing above is not releasing the object that was created, which was myFormatter, but instead, you are calling the dealloc() method on the class NSDateFormatter. I am not sure what that does but you should not do it.
The correct way to release myFormatter is: myFormatter's release()
|