title: Switching between multiple UITableView with VoiceOver causes crash
body: <p>I have a <code>UIViewController</code> with the following view hierarchy:</p>
  
  <pre><code>    UIView (root of UIViewController)
        |__________
        |          |
  UITableView(A)  UIView (overlay view)
              ____|_______
             |            |
         UITableView(B)  UITableView(C)
  </code></pre>
  
  <p>None of the <code>UITableViews</code> are shown simultaneously – I simply switch between them for various reasons: one is for normal items, one is used for searching results, etc.</p>
  
  <p>I'm getting this crash, somewhat consistently, by turning on <code>VoiceOver</code>, causing <code>UITableView</code> B to appear, dismissing it, and then navigating through accessibility items in <code>UITableView</code> A.</p>
  
  <p>Here's the call stack:</p>
  
  <pre><code>Thread : Crashed: com.apple.main-thread
  0  libobjc.A.dylib                0x00000001954a7bd0 objc_msgSend + 16
  1  UIKit                          0x000000018317ea68 -[UITableViewCellAccessibility _accessibilityReuseChildren:forMockParent:] + 496
  2  UIKit                          0x000000018318f28c -[UITableViewCellAccessibilityElement tableViewCell] + 260
  3  UIKit                          0x000000018318fcac -[UITableViewCellAccessibilityElement isAccessibilityElement] + 24
  4  UIAccessibility                0x0000000191c2c030 _appendChildrenToArrayStartingAtIndexWithChildren + 352
  5  UIAccessibility                0x0000000191c2bd04 _addAXElementsToArrayFromObject + 1620
  6  UIAccessibility                0x0000000191c2b680 _appendVendedAXElementsFromUIElements + 288
  7  UIAccessibility                0x0000000191c2b53c _createAXUIElementsFromUIElements + 160
  8  UIAccessibility                0x0000000191c2a3cc _copyParameterizedAttributeValueCallback + 208
  9  AXRuntime                      0x000000018a5f4a30 _AXXMIGCopyParameterizedAttributeValue + 256
  10 AXRuntime                      0x000000018a5f0850 _XCopyParameterizedAttributeValue + 412
  11 AXRuntime                      0x000000018a5fbbc0 mshMIGPerform + 272
  12 CoreFoundation                 0x0000000184cf6200 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
  13 CoreFoundation                 0x0000000184cf6160 __CFRunLoopDoSource1 + 436
  14 CoreFoundation                 0x0000000184cf40e0 __CFRunLoopRun + 1640
  15 CoreFoundation                 0x0000000184c210a4 CFRunLoopRunSpecific + 396
  16 GraphicsServices               0x000000018ddc35a4 GSEventRunModal + 168
  17 UIKit                          0x00000001895563c0 UIApplicationMain + 1488
  18 Stack Exchange                 0x000000010018dbe4 main (main.m:16)
  19 libdyld.dylib                  0x0000000195b02a08 start + 4
  </code></pre>
  
  <p>The crashing error is:</p>
  
  <p><code>[UITableTextAccessibilityElement accessibilityContainer] message sent to deallocated instance</code></p>
  
  <p>I'm running on <code>iOS</code> 8.1.2. </p>
  
  <p>Clearly, this has something to do with <code>VoiceOver</code>, or rather, the way <code>UIAccessibility</code> is navigating through its accessibility elements, trying to access a deallocated object. I've tried posting accessibility notifications  such as <code>UIAccessibilityScreenChangedNotification</code> and <code>UIAccessibilityLayoutChangedNotification</code> after hiding and showing the <code>UITableView</code>s to let the <code>accessibility</code> know that the screen has changed, but haven't had any luck. </p>
  
  <p>My <code>UITableView</code>s A and C also have some extra subviews, used as refresh/load more controls, but even removing these isn't helping.</p>
  
  <p><strong>Update:</strong> I am also getting these warnings when using <code>VoiceOver</code> to tap on a <code>UITextField</code> which is a subview of <code>UITableView</code>(a) <code>headerView</code> property:</p>
  
  <pre><code>**** Accessibility: Could not find a valid index for &lt;SESearchBar: 0x16a03150; frame = (0 0; 320 44); text = ''; layer = &lt;CALayer: 0x16a02fc0&gt;&gt; in -[UITableView indexOfAccessibilityElement:]
  |warning| **** Accessibility: Could not find where &lt;SESearchBar: 0x16a03150; frame = (0 0; 320 44); text = ''; layer = &lt;CALayer: 0x16a02fc0&gt;&gt; starts. Was its parent [&lt;UITableView: 0x16208a00; frame = (0 0; 320 504); clipsToBounds = YES; autoresize = RM+BM; gestureRecognizers = &lt;NSArray: 0x16b4a8c0&gt;; layer = &lt;CALayer: 0x16b49750&gt;; contentOffset: {0, 0}; contentSize: {320, 1800}&gt;] set correctly or did it disappear?
  </code></pre>