Application crashes when popViewControllerAnimated is called while scrolling
        Posted  
        
            by Aldrich
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Aldrich
        
        
        
        Published on 2010-04-30T09:41:19Z
        Indexed on 
            2010/04/30
            9:47 UTC
        
        
        Read the original article
        Hit count: 234
        
iphone
In one screen I have a custom toolbar with a "close" button in it, and a UIScrollView. In the screen that preceded this one I had pushed the current screen into the navigation stack. I had also disabled the navigation toolbar for a larger display area and so the close button would instead be used to call:
- (void)doClose {
    [self.navigationController popViewControllerAnimated:YES];
}
Now here's the problem: the application crashes when the close button is pressed, while the UIScrollView is moving. Here's the debugger stack trace:
0 __forwarding__
1 __forwarding_prep_0___
2 -[UIToolbarButton setHighlighted:]
3 -[UIControl(Static) _unhighlight]
4 __NSFireDelayedPerform
...
and I do have the following line in the debugger console:
*** -[CALayer setOpacity:]: message sent to deallocated instance 0x718d250
(sometimes setOpacity would be setNeedsDisplay or something related)
There won't be any crashes while the scrollview is at rest. What is happening?
© Stack Overflow or respective owner