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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:01:18+00:00 2026-05-23T11:01:18+00:00

I have a parent table view controller with a readonly detail view controller property

  • 0

I have a parent table view controller with a readonly detail view controller property on it that lazily instantiates a detail view controller. If I am on an iphone/ipod, I configure and push the detail view controller when an item in the table gets selected. When the detail view is visible and I click back twice in the navigation controller, the detail controller then the parent controller get popped and the parent’s dealloc gets called. When the parent’s dealloc reaches the line where I call [detailViewController release], I get a crash with EXC_BAD_ACCESS from the navigation controller. That makes me think that my problem is with memory management of the detailViewController, but debugging with NSZombies shows no problems. (Commenting out the [detailViewController release] line makes the crash go away but then I never have a release to balance out the detailViewController’s alloc — memorey leak) Any ideas why I get this crash?

EDIT:
here’s a stack trace for the crash:

Program received signal:  “EXC_BAD_ACCESS”.
(gdb) bt
#0  0x01046a63 in objc_msgSend ()
#1  0x0a9d72a0 in ?? ()
#2  0x0000cb4c in -[MyTableViewController dealloc] (self=0xa956840, _cmd=0x127a9d6) at /Users/nick/Documents/MyApp/Classes/MyTableViewController.m:290
#3  0x00390f1d in -[UINavigationController setDisappearingViewController:] ()
#4  0x0038e4f6 in -[UINavigationController _clearLastOperation] ()
#5  0x0038ee3f in -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:] ()
#6  0x0051be23 in -[UINavigationTransitionView _notifyDelegateTransitionDidStopWithContext:] ()
#7  0x0051cfd2 in -[UINavigationTransitionView _cleanupTransition] ()
#8  0x00308665 in -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] ()
#9  0x003084f7 in -[UIViewAnimationState animationDidStop:finished:] ()
#10 0x0200c6cb in run_animation_callbacks ()
#11 0x0200c589 in CA::timer_callback ()
#12 0x01225fe3 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ ()
#13 0x01227594 in __CFRunLoopDoTimer ()
#14 0x01183cc9 in __CFRunLoopRun ()
#15 0x01183240 in CFRunLoopRunSpecific ()
#16 0x01183161 in CFRunLoopRunInMode ()
#17 0x01a5a268 in GSEventRunModal ()
#18 0x01a5a32d in GSEventRun ()
#19 0x002e642e in UIApplicationMain ()
#20 0x00001b28 in main (argc=1, argv=0xbffff070) at /Users/nick/Documents/MyApp/main.m:14

EDIT2:
dealloc method where the crash happens:

- (void)dealloc
{
    [context release]; // a managed object context -- when table entries are selected, they get cached in core data
    [tableDataArray release];
    [detailViewController release]; // <-- line 290, this is where it crashes
    [super dealloc];
}
  • 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-23T11:01:19+00:00Added an answer on May 23, 2026 at 11:01 am

    You’ve either:

    A) Forgotten to retain the object stored to your detailViewController ivar

    or

    B) Released the object stored to your detailViewController ivar too many times

    Thus when you attempt to release detailViewController in your -dealloc method, it’s already been deallocated and points to invalid memory. You should audit the places where you set the value of detailViewController in this class for one of these situations. If you aren’t seeing it, add the code where you manipulate that ivar to your question so we can examine it.

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

Sidebar

Related Questions

I have a Nav controller that starts at a table view. Each row pushes
So I have a parent that defines a onmouseup event that hide/display a table.
I have a table view that's showing a list of bank transactions. When I
Using: Rails 3.1.1 I have a controller/model/view called Category that is built up on
I have a parent table called 'Website' which holds records about websites. I have
If I have a parent table and a child table where there can be
I have a simple parent/child tables. Contract is the parent table. Each contract can
I have db table with parent child relationship as: NodeId NodeName ParentId ------------------------------ 1
I have implemented inheritance for two parent classes called Table and Field . Each
I have a table which defines a child-parent relationship between nodes: CREATE TABLE node

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.