title: App terminate due to - uncaught exception 'NSGenericException',
body: <p>I got the below error while fetching some data from sever. While fetching data, i m displaying an custom alert view with activity indicator. Alert is using main thread while data fetching is done by NSThread. This problem occurs only at some time, not always. I m not able to understand what to do.</p>
  
  <p><strong>* Terminating app due to uncaught exception 'NSGenericException', reason: '*</strong> Collection  was mutated while being enumerated.(
      "",
      "",
      ""
  )'</p>
  
  <p><em>*</em> Call stack at first throw:
  (</p>
  
  <pre><code>0   CoreFoundation                      0x00f2abe9 __exceptionPreprocess + 185
  1   libobjc.A.dylib                     0x0107f5c2 objc_exception_throw + 47
  2   CoreFoundation                      0x00f2a6a9 __NSFastEnumerationMutationHandler + 377
  3   UIKit                               0x00371b8e -[UIView(Hierarchy) _findFirstSubviewWantingToBecomeFirstResponder] + 189
  4   UIKit                               0x00366a13 -[UIView(Hierarchy) _promoteDescendantToFirstResponderIfNecessary] + 42
  5   MyApplnName                        0x00015154 -[SecondViewController getDataFromServer] + 1798
  6   Foundation                          0x000a1d4c -[NSThread main] + 81
  7   Foundation                          0x000a1cd8 __NSThread__main__ + 1387
  8   libSystem.B.dylib                   0x928db7fd _pthread_start + 345
  9   libSystem.B.dylib                   0x928db682 thread_start + 34
  </code></pre>
  
  <p>)</p>
  
  <p>terminate called after throwing an instance of 'NSException'</p>