title: EXC_BAD_ACCESS code=1 crash on UIScrollView pinch gesture
body: <p>My app has a UIScrollView with some items on it (such as UITextField), and for the most part, when the view loads with this scroll view, I am able to pinch to zoom in and out and it works fine.</p>
  
  <p>However, sometimes I get some messages when I zoom in and out in the console that look like this:</p>
  
  <pre><code>CALayerGetSuperlayer called on instance of __NSArrayM
  CALayerGetSuperlayer called on instance of NSShadow
  CALayerGetSuperlayer called on instance of __NSCFString
  CALayerGetSuperlayer called on instance of __NSCFType
  CALayerGetSuperlayer called on instance of UIButtonContent
  </code></pre>
  
  <p>And other times I get a crash that always looks like this:</p>
  
  <pre><code>* thread #1: tid = 0x2503, 0x3b8155b6 libobjc.A.dylib`objc_msgSend + 22, stop reason = EXC_BAD_ACCESS (code=1, address=0x4)
      frame #0: 0x3b8155b6 libobjc.A.dylib`objc_msgSend + 22
      frame #1: 0x3552e9d4 QuartzCore`CALayerGetSuperlayer + 92
      frame #2: 0x357c0e5e UIKit`-[UIView(Hierarchy) containsView:] + 34
      frame #3: 0x358eb3d4 UIKit`-[UITextSelectionView affectedByScrollerNotification:] + 140
      frame #4: 0x35a5b394 UIKit`-[UITextSelectionView scaleWillChange:] + 24
      frame #5: 0x338c7036 CoreFoundation`_CFXNotificationPost + 1426
      frame #6: 0x341dd598 Foundation`-[NSNotificationCenter postNotificationName:object:userInfo:] + 72
      frame #7: 0x341e105a Foundation`-[NSNotificationCenter postNotificationName:object:] + 30
      frame #8: 0x35910bea UIKit`-[UIScrollView _updatePinchGestureForState:] + 946
      frame #9: 0x3589bd88 UIKit`_UIGestureRecognizerSendActions + 128
      frame #10: 0x358633f4 UIKit`-[UIGestureRecognizer _updateGestureWithEvent:] + 392
      frame #11: 0x35a50a38 UIKit`___UIGestureRecognizerUpdate_block_invoke_0543 + 48
      frame #12: 0x3578782e UIKit`_UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 218
      frame #13: 0x35786292 UIKit`_UIGestureRecognizerUpdate + 1274
      frame #14: 0x357911e6 UIKit`-[UIWindow _sendGesturesForEvent:] + 766
      frame #15: 0x35790db2 UIKit`-[UIWindow sendEvent:] + 90
      frame #16: 0x3577e800 UIKit`-[UIApplication sendEvent:] + 380
      frame #17: 0x3577e11a UIKit`_UIApplicationHandleEvent + 6154
      frame #18: 0x374725a2 GraphicsServices`_PurpleEventCallback + 590
      frame #19: 0x374721d2 GraphicsServices`PurpleEventCallback + 34
      frame #20: 0x3394b172 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
      frame #21: 0x3394b116 CoreFoundation`__CFRunLoopDoSource1 + 138
      frame #22: 0x33949f98 CoreFoundation`__CFRunLoopRun + 1384
      frame #23: 0x338bcebc CoreFoundation`CFRunLoopRunSpecific + 356
      frame #24: 0x338bcd48 CoreFoundation`CFRunLoopRunInMode + 104
      frame #25: 0x374712ea GraphicsServices`GSEventRunModal + 74
      frame #26: 0x357d2300 UIKit`UIApplicationMain + 1120
      frame #27: 0x000134a4 MyApp`main(argc=3, argv=0x2fdefc68) + 48 at main.m:14
      frame #28: 0x00013470 MyApp`start + 40
  </code></pre>
  
  <p>My app uses ARC, and I have tried to run with zombies turned on, in which case the app just crashes and Instruments does not show any issues.</p>
  
  <p>Any ideas as to what could be going on or what to do to chase down this issue?</p>
  
  <p>EDIT: Per Steve's suggestion, I went back in and rechecked it with zombies turned on, and as it turns out, I must have done something incorrectly on the first time around. Now, when I run on the simulator with Instruments looking for zombies, I do get a zombie showing up when I try to dismiss the modal dialog that contains the UIScrollView that contains the controls. Here is a screen capture of the Instruments when the zombie appears:</p>
  
  <p><img src="https://i.stack.imgur.com/tcU94.png" alt="Zombieland"></p>
  
  <p>What's maddening here is that I have to open and close the modal many times before I get a crash or a zombie showing up. And that I do not see any of my own code showing up in the Object Summary History for the zombie object.</p>