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

  • SEARCH
  • Home
  • 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 6707873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:41:28+00:00 2026-05-26T07:41:28+00:00

In my app, I switch between views modally. My problem is, when I move

  • 0

In my app, I switch between views modally. My problem is, when I move from the first viewController to the second, it works. When I dismiss the second view for the first time, that also works. Where is the problem, you say? It’s coming. When I move from the first viewController to the second a second time, it works again. Just as it should. Yet when I try to dismiss the second viewController the SECOND time, I get an EXC_BAD_ACCESS error on the

[self dismissModalViewControllerAnimated:YES];

line.

Why does it crash the second time, but never the first time?

EDIT ONE:

This error happens no matter which viewController I switch to:

If I move from A to B, then back to A, then to B, then try to go back to A: crash
If I move from A to C, then back to A, then to C, then try to go back to A: crash again

EDIT TWO:

I create/show the view controller with this code:

MapView *controller = [[MapView alloc] initWithNibName:@"MapView" bundle:nil];

controller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:controller animated:YES];

Should I be releasing this object after its creation?

Problem solved. Offending line of code was being used earlier for the transition I was using before I used modal views, and I forgot to remove it. Win.

  • 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-26T07:41:28+00:00Added an answer on May 26, 2026 at 7:41 am

    Typically, an EXC_BAD_ACCESS error means you are trying to reference a deallocated object, i.e. you are over-releasing something. Check back through your memory management, maybe run the Build/Build and Analyze tool.

    And yes, you should call [controller release]; after presenting the viewcontroller modally.

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

Sidebar

Related Questions

I added a navigation control to switch between views in my app. But some
In order to switch between views in my iOS app, I have been using
My app needs to switch between a couple of full screen views. These views
I have a UITabBarConroller that I use to switch between 3 different views. This
I have three views that I switch between using a tab bar, and the
I have View Controller with a (navigation controller) that can flip between 2 views
Usually I've used NSNavigationController to switch between different view controllers smoothly. Now, on the
In iOS, my views work individually but I can't switch between them. Now after
My app has 5 different relative layouts that it can switch between by using
I'm trying to switch between several table views as the root of a navigation

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.