I am developing an application for the iPhone, I am trying to call a view into the navigation controller, which I did many times before, however, I am having some problems with this particular application. I have a table view, and when the user selects one row, a new view is inserted into the controller:
DataWrapper *row=[[self.rows objectAtIndex:[indexPath section]] objectAtIndex:[indexPath row]]; DataViewController *nextController=[[DataViewController alloc] initWithNibName:@"Data" bundle:[NSBundle mainBundle]]; [nextController setInfo:row]; [nextController setRow:[indexPath row]]; [nextController setParent:self]; [self.navigationController pushViewController:nextController animated:YES]; [nextController release];
and everything will be fine until the user closes the back button, I get an exception and use NSZombieEnabled and get the following:
-[DataViewController respondsToSelector:]: message sent to deallocated instance 0x4637a00
So, I tried to remove the [nextController release] and it actually worked, but WHY ???? I highlighted nextController, so I have to release it, right? I do not feel right releasing this application, if there is something like this, I feel that it will fail. Please let me know your thoughts.
source share