TPKeyboardAvoiding icon indicating copy to clipboard operation
TPKeyboardAvoiding copied to clipboard

These two places often crash,I used the inputview

Open kilolumen opened this issue 10 years ago • 3 comments

screen shot 2014-10-15 at 8 37 23 am screen shot 2014-10-15 at 8 39 09 am

kilolumen avatar Oct 15 '14 00:10 kilolumen

Any idea what's going on here? I have the exact same issue.

pblondin avatar Mar 10 '15 17:03 pblondin

Same Issue. I am creating an instance of TPKeyboardAvoidingScrollView for my scroll view.

UIScrollView *scrollView = [[TPKeyboardAvoidingScrollView alloc]initWithFrame:CGRectNull];

Also, the keyboard fails to show up when the crash happens. On other views where ScrollView is not required, keyboard works fine (E.g. Search Bar in a Table View).

Error Details: Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [-4.25 nan]'

Stack Trace:

    0   CoreFoundation                      0x0000000108d6de65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x000000010845adeb objc_exception_throw + 48
    2   CoreFoundation                      0x0000000108d6dd9d +[NSException raise:format:] + 205
    3   QuartzCore                          0x000000010e4cca86 _ZN2CA5Layer12set_positionERKNS_4Vec2IdEEb + 152
    4   QuartzCore                          0x000000010e4ccbf9 -[CALayer setPosition:] + 44
    5   QuartzCore                          0x000000010e4cd25d -[CALayer setFrame:] + 650
    6   UIKit                               0x000000010966725f -[UIView(Geometry) setFrame:] + 356
    7   UIKit                               0x00000001097d12ad -[UIImageView _setViewGeometry:forMetric:] + 255
    8   UIKit                               0x00000001097d1514 -[UIImageView setFrame:] + 58
    9   UIKit                               0x000000010969e942 -[UIScrollView _adjustScrollerIndicators:alwaysShowingThem:] + 5461
    10  ****                                0x0000000107d3dbb9 -[UIScrollView(TPKeyboardAvoidingAdditions) TPKeyboardAvoiding_keyboardWillShow:] + 3097
    11  CoreFoundation                      0x0000000108d3a69c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12

EDIT: My case may be a little different. I am able to reproduce it 100% on simulator. The TextField uses UIKeyboardTypeNumberPad. Use case:

  1. User taps on TextField fills in the number.
  2. User taps on Next Button on Navigation Bar to navigate to next view.

It does not crash for following use case:

  1. User taps on TextField fills in the number.
  2. User taps on scroll view. Keyboard Dismisses.
  3. User taps on Next Button on Navigation Bar to navigate to next view.

Should I explicitly dismiss keyboard before navigating to next view ?

rachinkapoor avatar Mar 02 '16 23:03 rachinkapoor

Hey @rachin-pepo - would you be able to make/adapt a sample app demonstrating this issue?

michaeltyson avatar Mar 03 '16 01:03 michaeltyson