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 5992237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:30:09+00:00 2026-05-22T23:30:09+00:00

I always push a new view controller onto the stack like this: MyViewController *vc

  • 0

I always push a new view controller onto the stack like this:

 MyViewController *vc = [[MyViewController alloc] init];

[self.navigationController pushViewController:vc animated:YES];

[vc release];

And all works well when it comes to popping it off the stack with:

[self.navigationController popViewControllerAnimated:NO];

But now when I pop the vc off the stack I get a crash in main.m stating a bad access at line:int retVal = UIApplicationMain(argc, argv, nil, nil);

But now if I comment out [vc release] no more crash?

But why and surely this leaks memory as Im not releasing something I created?

  • 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-22T23:30:10+00:00Added an answer on May 22, 2026 at 11:30 pm

    Your memory management looks fine. Perhaps you are mismanaging the memory of something inside of your vc. What does the dealloc method of MyViewController look like?

    My guess is you are using the incorrect init method (perhaps initWithNibName:bundle:) and you are releasing ivars in dealloc that were never properly initialized.

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

Sidebar

Related Questions

I always seem to have a hard time starting a new Firefox extension. Can
I load view controllers all the time in the following format: -(void)loadSelectUser { MyViewController
I did a search on SO and looks like this question gets asked quite
In general chat application, client's browser always poll to server to check for new
I have a project based on Xcode's NavigationController template. This template has a navigationController
this is the question Shuffle. Now that you’ve finished your new sorting algorithm, how
I've always wondered since i learned about prototype inheritance why you push an instance
I'm new at the branching complexities of Git. I always work on a single
Sorry if this is trivial, but I am new to JS and have been
I have a UITableViewController that works in both portrait and landscape. From this controller

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.