I’m currently programming an app for iphone that uses the tab bar. One of the views it links to uses a navigation controller so that i can drill down the table view that I am using to display info to the user. It all works OK I can drill down the table view no problem, i can push the current table view off the view stack and return back up the stack to the first view using the back button in the navigation bar.
The problem I have is that if I drill down more than 1 view level and press the tab bar button for that view the application exits and Xcode shows a EXC_BAD_ACCESS.
The tab bars button is obviously trying to jump back to the first view in the stack, but should it be doing this?
If so, how do I make the button push everything from the stack or is it possible to disable the tab bar button from that view trying to show the top view again?
Its not really desirable for the whole app to return to the first view if the user accidentally taps the button.
Any help appreciated 🙂
I had an autorelease set on the view object I was trying to link back to from the tab bar and hadn’t noticed that I was also releasing the same object in the dealloc method also. So when I viewed the view the first time I clicked the tab it was still in memory but when coming back to the view its retain count had been set to zero removing it from memory altogether.
Solved it by removing the release cal in the dealloc method. Alternatively removing the autorelease would have done the same thing.