UIScrollView EXC_BAD_ACCESS crash in iOS SDK

I just worked through this problem myself.

I had an issue where:

  • A scrollview delegate was wired to a UIViewController
  • The scrollview began animating
  • The delegate went away and dealloc was called.

The problem was the scrollview delegate messages were firing on a new-deallocated object, and the crash logs were a bit confusing as they were pointing to nonsensical object references.

The fix was to set the scrollview delegate to nil as the first line of my view controller dealloc method.

Hope this helps someone else!

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)