Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regressions? Glitches/crashes when initial picker display includes contacts #48

Closed
brunchboy opened this issue Jan 15, 2014 · 3 comments

Comments

@brunchboy
Copy link

This had been working before, but as of tonight (using the master branch), when our picker is set up to contain contacts during the initial display of the view which contains it, they do not display properly. I suspect this may be due to the new approach to handling an empty prompt. Indeed, a quick test confirms that these problems go away if I leave the prompt at its default value of To: but occur when setting it to the empty string.

With a single contact present, the picker appears empty. But clicking on the right edge of the picker places the insertion point to the right of where the invisible contact should be. Trying to click on that invisible contact places the insertion point at the beginning of the line (leftmost edge of the picker). And trying to backspace over the invisible contact results in a crash:

2014-01-14 21:09:54.690 Cirrus[17973:70b] -[MBContactCollectionViewEntryCell setFocused:]: unrecognized selector sent to instance 0x144654e0
2014-01-14 21:09:54.696 Cirrus[17973:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MBContactCollectionViewEntryCell setFocused:]: unrecognized selector sent to instance 0x144654e0'
*** First throw call stack:
(
    0   CoreFoundation                      0x030f55e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x02e788b6 objc_exception_throw + 44
    2   CoreFoundation                      0x03192903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
    3   CoreFoundation                      0x030e590b ___forwarding___ + 1019
    4   CoreFoundation                      0x030e54ee _CF_forwarding_prep_0 + 14
    5   Cirrus                              0x000a2d73 -[MBContactCollectionView collectionView:didSelectItemAtIndexPath:] + 195
    6   Cirrus                              0x000a4189 -[MBContactCollectionView textField:shouldChangeCharactersInRange:replacementString:] + 729
    7   UIKit                               0x0209a7b6 -[UITextField keyboardInputShouldDelete:] + 252
    8   UIKit                               0x01b88ba7 -[UIKeyboardImpl callShouldDeleteWithWordCountForRapidDelete:characterCountForRapidDelete:] + 691
    9   UIKit                               0x01b93985 -[UIKeyboardImpl deleteFromInputWithExecutionContext:] + 84
    10  UIKit                               0x01b90415 -[UIKeyboardImpl handleDeleteAsRepeat:executionContext:] + 130
    11  UIKit                               0x01b9ec1f -[UIKeyboardImpl handleKeyWithString:forKeyEvent:executionContext:] + 633
    12  UIKit                               0x01b9e766 -[UIKeyboardImpl handleKeyEvent:executionContext:] + 1808
    13  UIKit                               0x01b9dfbf __33-[UIKeyboardImpl handleKeyEvent:]_block_invoke + 51
    14  UIKit                               0x020c23c8 -[UIKeyboardTaskQueue continueExecutionOnMainThread] + 402
    15  UIKit                               0x020c2a6f -[UIKeyboardTaskQueue addTask:] + 144
    16  UIKit                               0x01b9df84 -[UIKeyboardImpl handleKeyEvent:] + 227
    17  UIKit                               0x019c740b -[UIApplication _handleKeyUIEvent:] + 330
    18  UIKit                               0x01b0dfa4 -[UIResponder(Internal) _handleKeyUIEvent:] + 59
    19  UIKit                               0x01b0dfa4 -[UIResponder(Internal) _handleKeyUIEvent:] + 59
    20  UIKit                               0x01b0dfa4 -[UIResponder(Internal) _handleKeyUIEvent:] + 59
    21  UIKit                               0x01b0dfa4 -[UIResponder(Internal) _handleKeyUIEvent:] + 59
    22  UIKit                               0x01b0dfa4 -[UIResponder(Internal) _handleKeyUIEvent:] + 59
    23  UIKit                               0x01b0dfa4 -[UIResponder(Internal) _handleKeyUIEvent:] + 59
    24  UIKit                               0x01b0dfa4 -[UIResponder(Internal) _handleKeyUIEvent:] + 59
    25  UIKit                               0x01b0dfa4 -[UIResponder(Internal) _handleKeyUIEvent:] + 59
    26  UIKit                               0x01b0dfa4 -[UIResponder(Internal) _handleKeyUIEvent:] + 59
    27  UIKit                               0x01b0dfa4 -[UIResponder(Internal) _handleKeyUIEvent:] + 59
    28  UIKit                               0x01b0dfa4 -[UIResponder(Internal) _handleKeyUIEvent:] + 59
    29  UIKit                               0x01b0dfa4 -[UIResponder(Internal) _handleKeyUIEvent:] + 59
    30  UIKit                               0x01b0dfa4 -[UIResponder(Internal) _handleKeyUIEvent:] + 59
    31  UIKit                               0x01b0dfa4 -[UIResponder(Internal) _handleKeyUIEvent:] + 59
    32  UIKit                               0x01b0dfa4 -[UIResponder(Internal) _handleKeyUIEvent:] + 59
    33  UIKit                               0x01b0dfa4 -[UIResponder(Internal) _handleKeyUIEvent:] + 59
    34  UIKit                               0x01b0dfa4 -[UIResponder(Internal) _handleKeyUIEvent:] + 59
    35  UIKit                               0x019c72ba -[UIApplication handleKeyUIEvent:] + 84
    36  UIKit                               0x019c725e -[UIApplication handleKeyHIDEvent:] + 458
    37  UIKit                               0x019af07c _UIApplicationHandleEventQueue + 2954
    38  CoreFoundation                      0x0307e83f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
    39  CoreFoundation                      0x0307e1cb __CFRunLoopDoSources0 + 235
    40  CoreFoundation                      0x0309b29e __CFRunLoopRun + 910
    41  CoreFoundation                      0x0309aac3 CFRunLoopRunSpecific + 467
    42  CoreFoundation                      0x0309a8db CFRunLoopRunInMode + 123
    43  GraphicsServices                    0x052299e2 GSEventRunModal + 192
    44  GraphicsServices                    0x05229809 GSEventRun + 104
    45  UIKit                               0x019b3d3b UIApplicationMain + 1225
    46  Cirrus                              0x0002daed main + 141
    47  libdyld.dylib                       0x03aed70d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

With three initial contacts present, taking more than one line, the initial rendering of the view crashes as follows:

2014-01-14 21:03:36.411 Cirrus[17931:70b] *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-2903.23/UITableView.m:1330
2014-01-14 21:03:36.417 Cirrus[17931:70b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 2.  The number of rows contained in an existing section after the update (0) must be equal to the number of rows contained in that section before the update (1), plus or minus the number of rows inserted or deleted from that section (0 inserted, 0 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).'
*** First throw call stack:
(
    0   CoreFoundation                      0x030f55e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x02e788b6 objc_exception_throw + 44
    2   CoreFoundation                      0x030f5448 +[NSException raise:format:arguments:] + 136
    3   Foundation                          0x00cf3fee -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
    4   UIKit                               0x01a8485d -[UITableView _endCellAnimationsWithContext:] + 13402
    5   UIKit                               0x01a93caa -[UITableView endUpdatesWithContext:] + 51
    6   UIKit                               0x01a93cd8 -[UITableView endUpdates] + 41
    7   Cirrus                              0x0001e7c9 -[ComposeViewController contactPicker:didUpdateContentHeightTo:] + 201
    8   Cirrus                              0x000aad0b -[MBContactPicker contactCollectionView:willChangeContentSizeTo:] + 475
    9   Cirrus                              0x000a37ae -[MBContactCollectionView collectionView:willChangeContentSizeTo:] + 270
    10  Cirrus                              0x000a7a9a -[MBContactCollectionViewFlowLayout finalizeCollectionViewUpdates] + 362
    11  UIKit                               0x01fdab3f __37-[UICollectionView _updateWithItems:]_block_invoke1214 + 1774
    12  UIKit                               0x01a16282 +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 484
    13  UIKit                               0x01a16622 +[UIView(UIViewAnimationWithBlocks) animateWithDuration:delay:options:animations:completion:] + 108
    14  UIKit                               0x01fda16a -[UICollectionView _updateWithItems:] + 2097
    15  UIKit                               0x01fd5978 -[UICollectionView _endItemAnimations] + 14317
    16  UIKit                               0x01fdb4c4 -[UICollectionView _endUpdates] + 44
    17  UIKit                               0x01fdb66b -[UICollectionView performBatchUpdates:completion:] + 418
    18  Cirrus                              0x000a9aec -[MBContactPicker reloadData] + 812
    19  Cirrus                              0x000a8a83 -[MBContactPicker didMoveToWindow] + 339
    20  UIKit                               0x01a19077 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1689
    21  UIKit                               0x01a18cd7 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 761
    22  UIKit                               0x01a18cd7 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 761
    23  UIKit                               0x01a2a707 -[UIScrollView _didMoveFromWindow:toWindow:] + 65
    24  UIKit                               0x01a18cd7 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 761
    25  UIKit                               0x01a18cd7 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 761
    26  UIKit                               0x01a18cd7 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 761
    27  UIKit                               0x01a2a707 -[UIScrollView _didMoveFromWindow:toWindow:] + 65
    28  UIKit                               0x01a10500 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 162
    29  Foundation                          0x00ec738c -[NSISEngine withBehaviors:performModifications:] + 107
    30  Foundation                          0x00d56f05 -[NSISEngine withAutomaticOptimizationDisabled:] + 48
    31  UIKit                               0x01a103bd -[UIView(Hierarchy) _postMovedFromSuperview:] + 313
    32  UIKit                               0x01a1b4c1 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1847
    33  UIKit                               0x01a0e9b1 -[UIView(Hierarchy) addSubview:] + 56
    34  UIKit                               0x019aae05 -[_UIParallaxDimmingView didMoveToWindow] + 129
    35  UIKit                               0x01a19077 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1689
    36  UIKit                               0x01a18cd7 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 761
    37  UIKit                               0x01a10500 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 162
    38  Foundation                          0x00ec738c -[NSISEngine withBehaviors:performModifications:] + 107
    39  Foundation                          0x00d56f05 -[NSISEngine withAutomaticOptimizationDisabled:] + 48
    40  UIKit                               0x01a103bd -[UIView(Hierarchy) _postMovedFromSuperview:] + 313
    41  UIKit                               0x01a1b4c1 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1847
    42  UIKit                               0x01a0e9b1 -[UIView(Hierarchy) addSubview:] + 56
    43  UIKit                               0x019a7892 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke + 2001
    44  UIKit                               0x01a153ef +[UIView(Animation) performWithoutAnimation:] + 82
    45  UIKit                               0x019a6c96 -[_UINavigationParallaxTransition animateTransition:] + 1155
    46  UIKit                               0x01ae1e4e -[UINavigationController _startCustomTransition:] + 3446
    47  UIKit                               0x01aee0c7 -[UINavigationController _startDeferredTransitionIfNeeded:] + 688
    48  UIKit                               0x01aeecb9 -[UINavigationController __viewWillLayoutSubviews] + 57
    49  UIKit                               0x01c28181 -[UILayoutContainerView layoutSubviews] + 213
    50  UIKit                               0x01a1e267 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
    51  libobjc.A.dylib                     0x02e8a81f -[NSObject performSelector:withObject:] + 70
    52  QuartzCore                          0x0177a2ea -[CALayer layoutSublayers] + 148
    53  QuartzCore                          0x0176e0d4 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
    54  QuartzCore                          0x0176df40 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
    55  QuartzCore                          0x016d5ae6 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
    56  QuartzCore                          0x016d6e71 _ZN2CA11Transaction6commitEv + 393
    57  QuartzCore                          0x016d7544 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
    58  CoreFoundation                      0x030bd4ce __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
    59  CoreFoundation                      0x030bd41f __CFRunLoopDoObservers + 399
    60  CoreFoundation                      0x0309b344 __CFRunLoopRun + 1076
    61  CoreFoundation                      0x0309aac3 CFRunLoopRunSpecific + 467
    62  CoreFoundation                      0x0309a8db CFRunLoopRunInMode + 123
    63  GraphicsServices                    0x052299e2 GSEventRunModal + 192
    64  GraphicsServices                    0x05229809 GSEventRun + 104
    65  UIKit                               0x019b3d3b UIApplicationMain + 1225
    66  Cirrus                              0x0002daed main + 141
    67  libdyld.dylib                       0x03aed70d start + 1
    68  ???                                 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
@mhupman
Copy link
Member

mhupman commented Jan 15, 2014

Can you try with the latest develop branch and let me know if the issue still occurs there? I need to cut a release to master and CocoaPods, I'll go ahead and do so if we can confirm the bug is fixed there.

@brunchboy
Copy link
Author

I switched to your develop branch, and still get the crash:

[Alacrity:~/Projects/icm] james% pod install
Analyzing dependencies
Pre-downloading: `MBContactPicker` from `https://github.com/Citrrus/MBContactPicker`, branch `develop`
Just downloaded and checked out branch: develop from upstream /Users/james/Library/Caches/CocoaPods/GitHub/966712a74d86bc7dd1a6939217597bb10b1fcdc3
Downloading dependencies
Using AFNetworking (1.3.3)
Using DACircularProgress (2.1.0)
Using GTMHTTPFetcher (0.0.2)
Using HexColors (2.2.1)
Using ISO8601DateFormatterValueTransformer (0.5.0)
Installing MBContactPicker (0.1.2)
…

When the view initially tries to display with the picker containing three contacts over two lines:

2014-01-15 09:16:53.771 Cirrus[1636:70b] *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-2903.23/UITableView.m:1330
2014-01-15 09:16:53.787 Cirrus[1636:70b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 2.  The number of rows contained in an existing section after the update (0) must be equal to the number of rows contained in that section before the update (1), plus or minus the number of rows inserted or deleted from that section (0 inserted, 0 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).'
*** First throw call stack:
(
    0   CoreFoundation                      0x030f55e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x02e788b6 objc_exception_throw + 44
    2   CoreFoundation                      0x030f5448 +[NSException raise:format:arguments:] + 136
    3   Foundation                          0x00cf3fee -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
    4   UIKit                               0x01a8485d -[UITableView _endCellAnimationsWithContext:] + 13402
    5   UIKit                               0x01a93caa -[UITableView endUpdatesWithContext:] + 51
    6   UIKit                               0x01a93cd8 -[UITableView endUpdates] + 41
    7   Cirrus                              0x0001e119 -[ComposeViewController contactPicker:didUpdateContentHeightTo:] + 201
    8   Cirrus                              0x000aabeb -[MBContactPicker contactCollectionView:willChangeContentSizeTo:] + 475
    9   Cirrus                              0x000a35ee -[MBContactCollectionView collectionView:willChangeContentSizeTo:] + 270
    10  Cirrus                              0x000a794a -[MBContactCollectionViewFlowLayout finalizeCollectionViewUpdates] + 362
    11  UIKit                               0x01fdab3f __37-[UICollectionView _updateWithItems:]_block_invoke1214 + 1774
    12  UIKit                               0x01a16282 +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 484
    13  UIKit                               0x01a16622 +[UIView(UIViewAnimationWithBlocks) animateWithDuration:delay:options:animations:completion:] + 108
    14  UIKit                               0x01fda16a -[UICollectionView _updateWithItems:] + 2097
    15  UIKit                               0x01fd5978 -[UICollectionView _endItemAnimations] + 14317
    16  UIKit                               0x01fdb4c4 -[UICollectionView _endUpdates] + 44
    17  UIKit                               0x01fdb66b -[UICollectionView performBatchUpdates:completion:] + 418
    18  Cirrus                              0x000a9a8c -[MBContactPicker reloadData] + 812
    19  Cirrus                              0x000a8a33 -[MBContactPicker didMoveToWindow] + 339
    20  UIKit                               0x01a19077 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1689
    21  UIKit                               0x01a18cd7 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 761
    22  UIKit                               0x01a18cd7 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 761
    23  UIKit                               0x01a2a707 -[UIScrollView _didMoveFromWindow:toWindow:] + 65
    24  UIKit                               0x01a18cd7 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 761
    25  UIKit                               0x01a18cd7 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 761
    26  UIKit                               0x01a18cd7 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 761
    27  UIKit                               0x01a2a707 -[UIScrollView _didMoveFromWindow:toWindow:] + 65
    28  UIKit                               0x01a10500 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 162
    29  Foundation                          0x00ec738c -[NSISEngine withBehaviors:performModifications:] + 107
    30  Foundation                          0x00d56f05 -[NSISEngine withAutomaticOptimizationDisabled:] + 48
    31  UIKit                               0x01a103bd -[UIView(Hierarchy) _postMovedFromSuperview:] + 313
    32  UIKit                               0x01a1b4c1 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1847
    33  UIKit                               0x01a0e9b1 -[UIView(Hierarchy) addSubview:] + 56
    34  UIKit                               0x019aae05 -[_UIParallaxDimmingView didMoveToWindow] + 129
    35  UIKit                               0x01a19077 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1689
    36  UIKit                               0x01a18cd7 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 761
    37  UIKit                               0x01a10500 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 162
    38  Foundation                          0x00ec738c -[NSISEngine withBehaviors:performModifications:] + 107
    39  Foundation                          0x00d56f05 -[NSISEngine withAutomaticOptimizationDisabled:] + 48
    40  UIKit                               0x01a103bd -[UIView(Hierarchy) _postMovedFromSuperview:] + 313
    41  UIKit                               0x01a1b4c1 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1847
    42  UIKit                               0x01a0e9b1 -[UIView(Hierarchy) addSubview:] + 56
    43  UIKit                               0x019a7892 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke + 2001
    44  UIKit                               0x01a153ef +[UIView(Animation) performWithoutAnimation:] + 82
    45  UIKit                               0x019a6c96 -[_UINavigationParallaxTransition animateTransition:] + 1155
    46  UIKit                               0x01ae1e4e -[UINavigationController _startCustomTransition:] + 3446
    47  UIKit                               0x01aee0c7 -[UINavigationController _startDeferredTransitionIfNeeded:] + 688
    48  UIKit                               0x01aeecb9 -[UINavigationController __viewWillLayoutSubviews] + 57
    49  UIKit                               0x01c28181 -[UILayoutContainerView layoutSubviews] + 213
    50  UIKit                               0x01a1e267 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
    51  libobjc.A.dylib                     0x02e8a81f -[NSObject performSelector:withObject:] + 70
    52  QuartzCore                          0x0177a2ea -[CALayer layoutSublayers] + 148
    53  QuartzCore                          0x0176e0d4 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
    54  QuartzCore                          0x0176df40 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
    55  QuartzCore                          0x016d5ae6 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
    56  QuartzCore                          0x016d6e71 _ZN2CA11Transaction6commitEv + 393
    57  QuartzCore                          0x016d7544 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
    58  CoreFoundation                      0x030bd4ce __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
    59  CoreFoundation                      0x030bd41f __CFRunLoopDoObservers + 399
    60  CoreFoundation                      0x0309b344 __CFRunLoopRun + 1076
    61  CoreFoundation                      0x0309aac3 CFRunLoopRunSpecific + 467
    62  CoreFoundation                      0x0309a8db CFRunLoopRunInMode + 123
    63  GraphicsServices                    0x052299e2 GSEventRunModal + 192
    64  GraphicsServices                    0x05229809 GSEventRun + 104
    65  UIKit                               0x019b3d3b UIApplicationMain + 1225
    66  Cirrus                              0x0002d43d main + 141
    67  libdyld.dylib                       0x03aed70d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

@mhupman
Copy link
Member

mhupman commented Jan 15, 2014

@brunchboy Thanks for the info. I've think I've tracked down the cause of the bug, I hope to have a PR up shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants