I have a UIViewController (name it NumberTwo) which I introduced as a modal view controller from another UIViewController (name it NumberOne). NumberTwo contains a touchhesBegan method that listens for touches, and also has an accelerometer method that listens for device orientation changes in the x, y, or z direction. NumberTwo has a "Done" button, which when pressed, is rejected as a modal view controller:
[self dismissModalViewControllerAnimated:NO]
But it looks like he is still listening to touch, and he is still listening to acceleration. How can I completely free NumberTwo when I fire him? I tried adding a call to release as follows:
[self dismissModalViewControllerAnimated:NO]; [self release];
but it caused EXEC_BAD_ACCESS.
source share