title: iOS app crashes after idle for a while
body: <p>My app crashes after goes idle for a 30 mins. Below is the Crash Report..</p>
  
  <p>The app is loaded but when I try to open a popupover control (WYPopoverControl) it doesn't open and after a while when I focus on any text box it will crash randomly. After the crash, when the app re-opens everything will resume working without issues. How do I debug such issues?</p>
  
  <p>the crash looks like I am not removing the observer from Notification center.. I put the RemoveObserver in the dealloc os all the places required.. but still it crashes</p>
  
  <pre><code>Thread 0 Crashed:
  0   libobjc.A.dylib                 0x39a8fb26 objc_msgSend + 6
  1   CoreFoundation                  0x2f616116 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 10
  2   CoreFoundation                  0x2f58a252 _CFXNotificationPost + 1714
  3   Foundation                      0x2ff6fc28 -[NSNotificationCenter postNotificationName:object:userInfo:] + 72
  4   UIKit                           0x31dcc6b2 -[UIDevice setOrientation:animated:] + 290
  5   UIKit                           0x31dcbcfc -[UIApplication handleEvent:withNewEvent:] + 1304
  6   UIKit                           0x31dcb71c -[UIApplication sendEvent:] + 68
  7   UIKit                           0x31e30b38 _UIApplicationHandleEvent + 660
  8   GraphicsServices                0x342af70a _PurpleEventCallback + 606
  9   GraphicsServices                0x342af2f2 PurpleEventCallback + 30
  10  CoreFoundation                  0x2f61e9dc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
  11  CoreFoundation                  0x2f61e976 __CFRunLoopDoSource1 + 342
  12  CoreFoundation                  0x2f61d14a __CFRunLoopRun + 1394
  13  CoreFoundation                  0x2f587c22 CFRunLoopRunSpecific + 518
  14  CoreFoundation                  0x2f587a06 CFRunLoopRunInMode + 102
  15  GraphicsServices                0x342ae27e GSEventRunModal + 134
  16  UIKit                           0x31e2b044 UIApplicationMain + 1132
  17  dark                            0x000e7a78 0xe0000 + 31352
  18  libdyld.dylib                   0x39f9cab4 start + 0
  
  Thread 1:
  0   libsystem_kernel.dylib          0x3a04083c kevent64 + 24
  1   libdispatch.dylib               0x39f81210 _dispatch_mgr_invoke + 228
  2   libdispatch.dylib               0x39f80f96 _dispatch_mgr_thread$VARIANT$mp + 34
  
  Thread 2:
  0   libsystem_kernel.dylib          0x3a052f38 __psynch_cvwait + 24
  1   libsystem_pthread.dylib         0x3a0bb224 _pthread_cond_wait + 536
  2   libsystem_pthread.dylib         0x3a0bc000 pthread_cond_wait + 36
  3   Foundation                      0x2ffc23f2 -[NSCondition wait] + 190
  4   dark                            0x002e11aa 0xe0000 + 2101674
  5   Foundation                      0x30037c82 __NSThread__main__ + 1058
  6   libsystem_pthread.dylib         0x3a0bbc1a _pthread_body + 138
  7   libsystem_pthread.dylib         0x3a0bbb8a _pthread_start + 98
  8   libsystem_pthread.dylib         0x3a0b9c8c thread_start + 4
  
  Thread 3:
  0   libsystem_kernel.dylib          0x3a040a8c mach_msg_trap + 20
  1   libsystem_kernel.dylib          0x3a040888 mach_msg + 44
  2   CoreFoundation                  0x2f61e7be __CFRunLoopServiceMachPort + 150
  3   CoreFoundation                  0x2f61cee4 __CFRunLoopRun + 780
  4   CoreFoundation                  0x2f587c22 CFRunLoopRunSpecific + 518
  5   CoreFoundation                  0x2f587a06 CFRunLoopRunInMode + 102
  6   Foundation                      0x2ff753d6 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
  7   Foundation                      0x2ffc630c -[NSRunLoop(NSRunLoop) run] + 76
  8   dark                            0x003073a0 0xe0000 + 2257824
  9   Foundation                      0x30037c82 __NSThread__main__ + 1058
  10  libsystem_pthread.dylib         0x3a0bbc1a _pthread_body + 138
  11  libsystem_pthread.dylib         0x3a0bbb8a _pthread_start + 98
  12  libsystem_pthread.dylib         0x3a0b9c8c thread_start + 4
  
  Thread 4 name:  com.apple.NSURLConnectionLoader
  Thread 4:
  0   libsystem_kernel.dylib          0x3a040a8c mach_msg_trap + 20
  1   libsystem_kernel.dylib          0x3a040888 mach_msg + 44
  2   CoreFoundation                  0x2f61e7be __CFRunLoopServiceMachPort + 150
  3   CoreFoundation                  0x2f61cee4 __CFRunLoopRun + 780
  4   CoreFoundation                  0x2f587c22 CFRunLoopRunSpecific + 518
  5   CoreFoundation                  0x2f587a06 CFRunLoopRunInMode + 102
  6   Foundation                      0x2ffc22f2 +[NSURLConnection(Loader) _resourceLoadLoop:] + 314
  7   Foundation                      0x30037c82 __NSThread__main__ + 1058
  8   libsystem_pthread.dylib         0x3a0bbc1a _pthread_body + 138
  9   libsystem_pthread.dylib         0x3a0bbb8a _pthread_start + 98
  10  libsystem_pthread.dylib         0x3a0b9c8c thread_start + 4
  
  Thread 5 name:  AFNetworking
  Thread 5:
  0   libsystem_kernel.dylib          0x3a040a8c mach_msg_trap + 20
  1   libsystem_kernel.dylib          0x3a040888 mach_msg + 44
  2   CoreFoundation                  0x2f61e7be __CFRunLoopServiceMachPort + 150
  3   CoreFoundation                  0x2f61cee4 __CFRunLoopRun + 780
  4   CoreFoundation                  0x2f587c22 CFRunLoopRunSpecific + 518
  5   CoreFoundation                  0x2f587a06 CFRunLoopRunInMode + 102
  6   Foundation                      0x2ff753d6 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
  7   Foundation                      0x2ffc630c -[NSRunLoop(NSRunLoop) run] + 76
  8   dark                            0x00151150 0xe0000 + 463184
  9   Foundation                      0x30037c82 __NSThread__main__ + 1058
  10  libsystem_pthread.dylib         0x3a0bbc1a _pthread_body + 138
  11  libsystem_pthread.dylib         0x3a0bbb8a _pthread_start + 98
  12  libsystem_pthread.dylib         0x3a0b9c8c thread_start + 4
  
  Thread 6 name:  com.apple.CFSocket.private
  Thread 6:
  0   libsystem_kernel.dylib          0x3a053440 select$DARWIN_EXTSN + 20
  1   CoreFoundation                  0x2f622680 __CFSocketManager + 480
  2   libsystem_pthread.dylib         0x3a0bbc1a _pthread_body + 138
  3   libsystem_pthread.dylib         0x3a0bbb8a _pthread_start + 98
  4   libsystem_pthread.dylib         0x3a0b9c8c thread_start + 4
  
  Thread 7:
  0   libsystem_kernel.dylib          0x3a040a8c mach_msg_trap + 20
  1   libsystem_kernel.dylib          0x3a040888 mach_msg + 44
  2   CoreFoundation                  0x2f61e7be __CFRunLoopServiceMachPort + 150
  3   CoreFoundation                  0x2f61cee4 __CFRunLoopRun + 780
  4   CoreFoundation                  0x2f587c22 CFRunLoopRunSpecific + 518
  5   CoreFoundation                  0x2f5cb736 CFRunLoopRun + 94
  6   CoreMotion                      0x2fc3e230 ___lldb_unnamed_function1404$$CoreMotion + 724
  7   libsystem_pthread.dylib         0x3a0bbc1a _pthread_body + 138
  8   libsystem_pthread.dylib         0x3a0bbb8a _pthread_start + 98
  9   libsystem_pthread.dylib         0x3a0b9c8c thread_start + 4
  
  Thread 8:
  0   libsystem_kernel.dylib          0x3a053c7c __workq_kernreturn + 8
  1   libsystem_pthread.dylib         0x3a0b9dc6 _pthread_wqthread + 306
  2   libsystem_pthread.dylib         0x3a0b9c80 start_wqthread + 4
  
  Thread 9:
  0   libsystem_kernel.dylib          0x3a053c7c __workq_kernreturn + 8
  1   libsystem_pthread.dylib         0x3a0b9dc6 _pthread_wqthread + 306
  2   libsystem_pthread.dylib         0x3a0b9c80 start_wqthread + 4
  
  Thread 10:
  0   libsystem_kernel.dylib          0x3a053c7c __workq_kernreturn + 8
  1   libsystem_pthread.dylib         0x3a0b9dc6 _pthread_wqthread + 306
  2   libsystem_pthread.dylib         0x3a0b9c80 start_wqthread + 4
  
  Thread 0 crashed with ARM Thread State (32-bit):
      r0: 0x17f45e70    r1: 0x00333765      r2: 0x1b88c240      r3: 0x00002060
      r4: 0x17f1cbc0    r5: 0x27d21b80      r6: 0x27d21bdc      r7: 0x27d21aa0
      r8: 0x1658a788    r9: 0x756f5935     r10: 0x00000000     r11: 0x00000001
      ip: 0x3a326744    sp: 0x27d21aa0      lr: 0x2f616119      pc: 0x39a8fb26
    cpsr: 0x20000030
  </code></pre>