Note that there are some explanatory texts on larger screens.

plurals
  1. POEXC_BAD_ACCESS when messaging a valid object
    text
    copied!<p>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.</p> <p>0)Based on gdb, the problem occurs in objc_msgSend. Both registers have a non-zero value.</p> <pre><code>gdb: 0x3367cc98 &lt;+0016&gt; ldr r5, [r4, #8] </code></pre> <p>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.</p> <p>I have no clue what's going on.</p> <p>This is the delegate property declaration (the parent controller outlives the child):</p> <pre><code>@property (assign) id&lt;ParentControllerDelegate&gt; delegate </code></pre> <p>This is the problematic code:</p> <pre><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 } </code></pre> <p>This is the the code on the delegate side (the delegate has been retained by the App_Delegate, as it is the main controller).</p> <pre><code>- (void) done: (UIViewController *) caller { NSLog(@"Taken back control");// this never displays [caller.view removeFromSuperview]; [caller release]; } </code></pre> <p>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.</p> <p>I'm really at loss here. Looking forward to your help.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload