xmartlabs/XLForm

Crash on XLFormViewController.m line 587

liraz opened this issue · 1 comments

liraz commented

It seems that a previous reference of XLFormController is being retained because it was killed before the viewDidDisappear was supposed to be called.
Then cell rowDescriptor cellConfig is actually nil - though most definitely had it before.

Here's the crash log:

Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x21452e528 object_isClass + 28
1  Foundation                     0x215dbd14c KVO_IS_RETAINING_ALL_OBSERVERS_OF_THIS_OBJECT_IF_IT_CRASHES_AN_OBSERVER_WAS_OVERRELEASED_OR_SMASHED + 72
2  (Missing)                      0x1f8d0215dba7e0 (Missing)
3  (Missing)                      0x298b024330363c (Missing)
4  (Missing)                      0x52c3810467a718 (Missing)
5  XLForm                         0x104682bd0 -[XLFormViewController configureCell:] (XLFormViewController.m:587)
6  XLForm                         0x104682b6c -[XLFormViewController updateFormRow:] (XLFormViewController.m:579)
7  ****                           0x102ee13d0 -[DRProfilePageViewController(XLForm) updateFormValues] (DRProfilePageViewController+XLForm.m:407)
8  *****                           0x102e85c9c -[DRProfilePageViewController(TOLO) onDRUsaStateServiceEvent:] (DRProfilePageViewController+TOLO.m:167)
9  libobjc.A.dylib                0x21452b604 -[NSObject performSelector:withObject:] + 68
10 (Missing)                      0x9ab0104717634 (Missing)
11 *****                           0x102f4fcd0 -[Tolo(DRSwizzling) dr_publish:] (Tolo+DRCategory.m:47)
12 *****                           0x102f17598 __28-[DRUsaStateService findAll]_block_invoke (DRUsaStateService.m:127)
13 *****                           0x102e2f7e0 __42-[DRStatesApi findAllWithSuccess:failure:]_block_invoke (DRStatesApi.m:21)
14 *****                           0x102f58df4 __66-[DRApiBase process:method:parameters:serializer:success:failure:]_block_invoke_2 (DRApiBase.m:175)
15 *****                           0x102f59a00 __44-[DRApiBase processRequest:success:failure:]_block_invoke_2 (DRApiBase.m:229)
16 AFNetworking                   0x103f2765c __72-[AFURLSessionManagerTaskDelegate URLSession:task:didCompleteWithError:]_block_invoke_2.117 (AFURLSessionManager.m:248)
17 libdispatch.dylib              0x214d37d58 _dispatch_call_block_and_release + 32
18 (Missing)                      0x1bf50214d392f0 (Missing)
19 (Missing)                      0x67f40214d44e3c (Missing)
20 (Missing)                      0x133d82152c22a4 (Missing)
21 (Missing)                      0x45f702152bcf48 (Missing)
22 (Missing)                      0x4f2e82152bc4b8 (Missing)
23 (Missing)                      0x50a3021756fbe8 (Missing)
24 (Missing)                      0x743b8242ff01b8 (Missing)
25 (Missing)                      0x733d8102d85e2c (Missing)
26 libdyld.dylib                  0x214d71050 start + 4

Hi @liraz thanks for reporting this.
I agree the removeObserver calls should be in the dealloc as well. However, it is good to keep them in viewWillDisappear so that the view controller does only get notified if the view is being shown.