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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:17:12+00:00 2026-05-25T06:17:12+00:00

My main app controller invokes a subcontroller to handle a certain sequence of screens.

  • 0

My main app controller invokes a subcontroller to handle a certain sequence of screens. The main controller sets itself as a delegate in the subcontroller. When the subcontroller is done doing its stuff, it notifies the delegate. Every now and then, this notification fails with EXC_BAD_ACCESS.

0)Based on gdb, the problem occurs in objc_msgSend. Both registers have a non-zero value.

gdb: 0x3367cc98  <+0016>  ldr   r5, [r4, #8]

1)I’ve tried NSZombiesEnabled to track the problem, but I couldn’t reproduce it then.
2)I’ve tried setting a breakpoint just before the problematic command, but again I can’t reproduce the issue.

I have no clue what’s going on.

This is the delegate property declaration (the parent controller outlives the child):

@property (assign) id<ParentControllerDelegate> delegate

This is the problematic code:

- (void) doStuff {
   if(mode == Done) {
     NSLog(@"Done. Handling back control");//this is the last log displayed by the console
     [self.delegate done: self];
   } else {
     // some controller code
}

This is the the code on the delegate side (the delegate has been retained by the App_Delegate, as it is the main controller).

- (void) done: (UIViewController *) caller {
   NSLog(@"Taken back control");// this never displays
   [caller.view removeFromSuperview];
   [caller release];
}

Some extra info:
The main controller retains the subcontroller.
I’ve also modified the deallocs in both the main and sub controllers to log when it is called. Based on the visible logs, neither is ever called during the course of the application. Hence both the receiver and the sender of the message are valid objects.

I’m really at loss here. Looking forward to your help.

  • 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-25T06:17:13+00:00Added an answer on May 25, 2026 at 6:17 am

    If the NSLog call in done: is never performed, that can only mean that you did not call the main controller’s done:. That can mean that self.delegate is not valid. The objects may be valid and alive, but not the link (self.delegate) between them. Check that, please. In doStuff, in the “Done” branch, show the address of self.delegate with

    NSLog(@"%p", self.delegate);
    

    before you call done: and compare that with the address of the main controller.

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

Sidebar

Related Questions

I have my main app view controller (File's Owner), its First Responder, View, and
I'm doing a addin system where the main app loads assemblies Addin1.dll and Addin2.dll
I have a medium-complex Rails app. The main controller (the one that does what
If I have a whole bunch of requires in my main app file: require
I need to move a folder from a plugin to the main app/views. I
I have a widget that supposed to call an Activity of the main app
I have a main C++ app built in Visual Studio 2005, called A.exe. It
At my shop, the main product app is a mongrel built on MFC, QT
Is there a way to make Windows Mobile not use the main phone app?
My app's main view has a uiwebview. It is white for a split second

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.