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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:20:48+00:00 2026-05-17T19:20:48+00:00

I have a modal view controller which is crashing when it dismisses itself. The

  • 0

I have a modal view controller which is crashing when it dismisses itself. The error is EXC_BAD_ACCESS (yipee). I am tryin got use NSZombie to work out the problem. I get am getting the following :

2010-10-20 17:15:58.936 [24058:207] AddRunningClient starting device on non-zero client count
2010-10-20 17:16:06.846 [24058:207] * -[ViewController retain]: message sent to deallocated instance 0x6c2d4a0

What does this mean – does it mean that a message was sent to the Viewcontroller or that a message was sent to an object in the Viewcontroller ?

I am really stuck as the thread seems to be main 🙁

Thanks all in advance for any help,

Martin

EDIT

Thanks all for the quick replies. Here is how I am presenting the view controller :

-(IBAction)letsstartGame {

ViewController * sl = [[ViewController alloc] initWithNibName:@"ViewController" bundle:[NSBundle mainBundle]];  
self.viewLink = sl;
[sl release];

[mainMenu stop];
[mainMenu setCurrentTime:0.0];

[self presentModalViewController:viewLink animated:NO];

[viewLink release];
self.viewLink = nil;

}

And dismiss like this :

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

if (waitingOver) {

    [backgroundMain stop];
    [fireworks stop];

    [self dismissModalViewControllerAnimated:NO];

}   

}

  • 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-17T19:20:49+00:00Added an answer on May 17, 2026 at 7:20 pm

    That means that you had an instance of an object of type ViewController, it was deallocated, and then you tried to retain it.

    edit

    You’re over-releasing the object. Here’s what you’re doing:

    ViewController * sl = [[ViewController alloc] initWithNibName:@"ViewController" bundle:[NSBundle mainBundle]];  //allocated, has a +1 retain count
    self.viewLink = sl;  //assuming a retain property, has a +2 retain count
    [sl release]; //releasing, now has +1 retain count
    ....    
    [viewLink release]; //releasing, now has a 0 retain count
    self.viewLink = nil; //attempting to release stale pointer, will result in a crash (perhaps not immediately, but eventually)
    

    Get rid of the [viewLink release] line. It is wrong to have that in there.

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

Sidebar

Related Questions

I have a view controller which presents a modal view when a certain button
I have two View Controllers: TableViewController (which is used as a modal view controller)
I have a simple project to present a modal view controller and transfer back
I display a modal view controller and from there use buttons to add subviews.
My UITable View does not refresh from its data source of an array, which
I'm trying to create a form sheet modal on iPad, which should be a
I'm writing an iPhone app. Starting from a view controller in a navigation stack
In some applications like Mail, when you have a UITextField, there is a little
If learned the hard way that you should remove the delegate from an object
I will try to explain myself as best as possible, I know the title

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.