iPhone dev tip of the day: clear your delegates!

3 Mar
2010

Just found a nasty crash with NSZombiesEnabled. A deallocated view was called with performsSelector. huh? who did this?

Turns out that’s a corner case, scrolling was not yet done (because animated) but due to low mem the view was discarded instantly. Then system called the view: hey, done with scrolling! kaboom.

So, rule of thumb: clear your delegates on viewWillDisappear and re-set them  on view WillAppear. No more troubles.

Thanks again, StackOverflow (a but cryptic this time)

Related posts:

  1. Tweetie like swipe menu for iPhone apps
  2. Blocks on the iPhone – PSAlertView

Comment Form

top

Switch to our mobile site