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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:44:31+00:00 2026-05-19T09:44:31+00:00

I have a view in my app that displays a UITableView. This view is

  • 0

I have a view in my app that displays a UITableView. This view is created in a nib file and has a custom view controller. The UIViewController subclass for this view acts as the Datasource and Delegate for the UITableView.

My UITableView displays several rows based on my data. Then, the last row displays different text: “Add another…”. If the last row is selected, I present a modal view controller (to allow the user to add more data). When I dismiss the modal view controller, I again see the original view (as expected) and all appears to be well. However, when I try to interact with this view, the app crashes.

From placing several NSLog() statements through the UIViewController (for the UITableView), I have determined that the -dealloc method is being called just after the modal view is dismissed. This explains the crash when I try to do something with that view. However, I have no idea why -dealloc is being called on this view controller.

To dismiss the modal view controller, I have:

[self dismissModalViewController:YES];

As the code in an IBAction method in the modal view controller’s UIViewController. This action is tied to a cancel button in the corresponding nib file.

In addition, my understanding from the View Controller Programming Guide is that it’s OK to dismiss the modal controller from within itself, but it’s more robust to use delegates. I was initially using a delegate, but took the delegate out to simplify debugging. I just put the delegate back in to double-check, and the same behavior occurs when using delegates. The modal controller’s action method calls is implemented as:

[[self delegate] myModalViewController:self didAddObject:obj];  

The delegate implementation in the parent view controller is:

[self dismissModalViewController:YES]

If anyone has seen this before or has any suggestions of what could be happening or how to debug this, I would greatly appreciate it.

  • 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-19T09:44:31+00:00Added an answer on May 19, 2026 at 9:44 am

    If -dealloc is being called, something is releasing the view controller. Try implementing -release in your view controller:

    -(void)release {
        NSLog(@"view controller released");
        [super release];
    }
    

    so that you can use the debugger to inspect the call stack when this unexpected release message happens.

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

Sidebar

Related Questions

I have an iPhone app that displays a modal view controller. The modal view
I have a view controller based app that contains several views that I display/hide
I have a custom view in my Android App that uses a ScaleGestureDetector.SimpleOnScaleGestureListener to
I have an app that has a centre view with two views off to
I have an app that I just got setup with a split view controller
I have an iPhone app that shows a simple view (View 1) that has
I have a very simple Mac Cocoa app that just has a Web View
In my app I have a view that is a form that has quite
I have a UIViewController, and within that view i have UITableView added in IB
I have setup a basic test app that displays a view containing a label,

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.