Question

I'm struggling with the following scenario and could use some different perspectives to shed some light on me:

I have a self.backstack which is an array of sections to go "back" to when you hit the back button. I'm getting an EXC_BAD_ACCESS when the back button is hit in a particular situation, but I'm not sure which object the code is mad about because everything seems there.

If you look on the bottom left of the image you'll see that self, backStack, and userInfo are all there. Not only that but their respective prints on are logged in the bottom right.

Any thoughts on what the problem might be? Thanks.

enter image description here

Was it helpful?

Solution

I suspect you have an observer of the notification which has been deallocated before it unregistered for the notifications.

Notifications are synchronous, which means that on the line you are crashing on, it is trying to run all of the observer callbacks. Check everywhere you are registering for these, and make sure the objects are either retained elsewhere, or are being properly unregistered (removeObserver iirc) when they are released.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top