Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6117419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:19:06+00:00 2026-05-23T15:19:06+00:00

I have a UIViewController (call it NumberTwo) which I presented as a modal view

  • 0

I have a UIViewController (call it NumberTwo) which I presented as a modal view controller from another UIViewController (call it NumberOne). NumberTwo contains a touchesBegan method which listens for touches, and it also has an accelerometer method which listens for device orientation changes in the x, y, or z direction. NumberTwo has a button called “Done” which, when tapped, dismisses itself as a modal view controller:

[self dismissModalViewControllerAnimated:NO];

But it seems as though it’s still listening for touches, and it’s still listening for accelerations. How can I completely free up NumberTwo when I dismiss it? I tried adding a release call as follows:

[self dismissModalViewControllerAnimated:NO];
[self release];

but that caused a EXEC_BAD_ACCESS.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:19:07+00:00Added an answer on May 23, 2026 at 3:19 pm

    Did you release the controller after you presented it? E.g. in your method in NumberOneController that presents it, do you have something like:

    NumberTwoController * controller = [NumberTwoController alloc] init];
    // do stuff to config controller
    [self presentModalViewController: controller];
    [controller release];
    

    Unless you want to hang on to NumberTwoController for re-use, this would be the usual pattern. The presentModalViewController method ensures that the controller is retained while it’s in use. It should then get tidied up when, within NumberTwoController, you call [self dismissModalViewControllerAnimated: NO].

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a root view controller which has few buttons. On click of these
I am having a serious issue with UITableView reloadData method. I have a UIViewController
I have UINavigation Controller that has a UIViewController pushed onto the stack and displayed.
I have a UIActionSheet that I am able to successfully call from a UIBarButtonItem
I have a UIViewController that manages the display of some data. When the user
I have an application with 5 UIViewController s each inside a corresponding UINavigationController ,
I have a UINavigationController containing an UIViewController initialized with a UIView. The UINavigationController also
Have just started using Visual Studio Professional's built-in unit testing features, which as I
I have a UIViewController that has a UIPickerView. The picker's datasource and delegate are
I do some iOS programming stuff and I have a UIViewController with a NSMutableArray

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.