My latest bump in the road occurs after having navigated through multiple images. It seems to me that this puts a strain on the memory, so the app decides to release the old NSMutableDictionaries that I have implemented for navigation. So now, after having viewed a few images, I go back into my navigation, and it crashes. I tried retaining all the NSMutableDictionaries in the .h file, at at first this seemed to help, but the problem still persists.
Edit: (10/8/09)
I finally discovered the source of all my frustration. While adding a piece of code designed to reset the "highlighted" or "selected" value on a table view back to the top entry, I had to define my own "NSIndexPath" and manually set its values. Then afterward I added a release for the variable I had just initialized, trying to be a good steward of my memory. It turns out that that release was my problem. After using "Leaks" I found out when the memory leak was happening. It had nothing to do with my dictionaries as I thought above it was due to my releasing of the NSIndexPath multiple times that caused the creation of any other tableView (ie. when I navigated back and tried a different route) to cause a crash.
And for reference the error that I received each crash was either one of these two.
"[NSIndexPath release]: message sent to deallocated instance."
"[NSIndexPath retain]: message sent to deallocated instance."
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment