2

Actually I really couldn't think of any reason why, with zombie or not, accessing deallocated object can happen at all. If a reference is strong, then object is not deallocated. If reference is weak then it's nilled when object is deallocated.

I suppose it could happen if people use assign pointer. But doing so would be asking for trouble.

However, sometimes my app do crash with this message:

Yet, the app did crash with error: message sent to deallocated instance 0x189f09c0

I have no idea why.

What happen is a UIViewController is pop out of UINavigationController. Then it's viewDidScroll is about to be called.

But that's strange.

I enabled zombie. However, enabling zombie shouldn't have been the case. This answer clearly shows that all weak references are niled even when debugging with zomie

Are all weak references nilled if we enable zombie object?

So what's going on?

Community
  • 1
  • 1
user4951
  • 32,206
  • 53
  • 172
  • 282
  • 3
    As I already commented to your previous questions: The delegate property of UIScrollView is **"assign", not "weak"**. So you have to set it to nil explicitly, as has been said in previous answers. – Martin R Dec 06 '13 at 08:19

1 Answers1

1

If you want to find out the deallocated instance and trace it's life circle (where and when it is retained and released), see the link

It really helps me a lot!

Community
  • 1
  • 1
KudoCC
  • 6,912
  • 1
  • 24
  • 53