nativecss / NativeCSS.framework

5 stars 4 forks source link

UIDatePickerView is not compatible with NativeCSS #4

Open dhilowitz opened 9 years ago

dhilowitz commented 9 years ago

As far as I can tell, UIDatePickerView is not compatible with NativeCSS. As soon as I add a UIDatePicker to my project using either Interface Builder or by adding it programmatically in code, my view crashes. I get this error:

2015-06-08 16:52:43.742 Beacon[54700:3053438] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 3 beyond bounds [0 .. 1]'
*** First throw call stack:
(
    0   CoreFoundation                      0x03c2c746 __exceptionPreprocess + 182
    1   libobjc.A.dylib                     0x00724a97 objc_exception_throw + 44
    2   CoreFoundation                      0x03b00b73 -[__NSArrayM objectAtIndex:] + 243
    3   UIKit                               0x01a7be8b -[UIPickerView selectedRowInComponent:] + 82
    4   UIKit                               0x021e62b5 -[_UIDatePickerMode_DateAndTime _shouldEnableValueForRow:inComponent:calendarUnit:] + 419
    5   UIKit                               0x021e232a -[_UIDatePickerMode _shouldEnableValueForRow:column:] + 86
    6   UIKit                               0x021e1f7c -[_UIDatePickerMode viewForRow:inComponent:reusingView:] + 704
    7   UIKit                               0x021e6466 -[_UIDatePickerMode_DateAndTime viewForRow:inComponent:reusingView:] + 174
    8   UIKit                               0x021d977d -[_UIDatePickerView pickerView:viewForRow:forComponent:reusingView:] + 66
    9   UIKit                               0x01a7c445 -[UIPickerView tableView:cellForRowAtIndexPath:] + 320
    10  UIKit                               0x021cd3e5 -[UIPickerColumnView tableView:cellForRowAtIndexPath:] + 61
    11  UIKit                               0x01bbf73d -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 473
    12  UIKit                               0x01bbf81f -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 77
    13  UIKit                               0x01b979cb -[UITableView _updateVisibleCellsNow:isRecursive:] + 3034
    14  UIKit                               0x01b95899 -[UITableView _updateVisibleCellsImmediatelyIfNecessary] + 76
    15  UIKit                               0x01baa050 -[UITableView _visibleCells] + 35
    16  UIKit                               0x01baa0a5 -[UITableView visibleCells] + 33
    17  Beacon                              0x002ca357 -[NCNativeCSS refreshChildStylesOfView:ignoreSubviews:] + 513
    18  Beacon                              0x002ca151 -[NCNativeCSS refreshChildStylesOfView:] + 48
    19  Beacon                              0x002ca9a3 -[NCNativeCSS refreshChildStylesOfView:ignoreSubviews:] + 2125
    20  Beacon                              0x002ca151 -[NCNativeCSS refreshChildStylesOfView:] + 48
    21  Beacon                              0x002ca9a3 -[NCNativeCSS refreshChildStylesOfView:ignoreSubviews:] + 2125
    22  Beacon                              0x0030274a -[UIView(NativeCSS) refreshCSSStyling] + 680
    23  Beacon                              0x002f9521 -[UIView(UIView_NativeCSSPrivate) didAddSubview:] + 1286
    24  UIKit                               0x01b225b9 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 2400
    25  UIKit                               0x01b149c6 -[UIView(Hierarchy) addSubview:] + 56
    26  UIKit                               0x01a79d6c -[UIPickerView layoutSubviews] + 4669
    27  UIKit                               0x021d9ade -[_UIDatePickerView layoutSubviews] + 115
    28  UIKit                               0x01b2557a -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 668
    29  libobjc.A.dylib                     0x0073a771 -[NSObject performSelector:withObject:] + 70
    30  QuartzCore                          0x01822e47 -[CALayer layoutSublayers] + 144
    31  QuartzCore                          0x01816925 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 403
    32  QuartzCore                          0x0181677a _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
    33  QuartzCore                          0x01772c52 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 284
    34  QuartzCore                          0x017740e5 _ZN2CA11Transaction6commitEv + 487
    35  QuartzCore                          0x017747fc _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
    36  CoreFoundation                      0x03b4d86e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
    37  CoreFoundation                      0x03b4d7b0 __CFRunLoopDoObservers + 400
    38  CoreFoundation                      0x03b431ea __CFRunLoopRun + 1226
    39  CoreFoundation                      0x03b42a5b CFRunLoopRunSpecific + 443
    40  CoreFoundation                      0x03b4288b CFRunLoopRunInMode + 123
    41  GraphicsServices                    0x07c182c9 GSEventRunModal + 192
    42  GraphicsServices                    0x07c18106 GSEventRun + 104
    43  UIKit                               0x01a92106 UIApplicationMain + 1526
    44  Beacon                              0x00110c44 main + 180
    45  libdyld.dylib                       0x04728ac9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

This occurs whether or not I have any CSS rules set up in my app at all. Merely adding NativeCSS to my Podfile and doing a pod update is enough to cause this error to show up. When I remove the library, everything works fine again. Also, when I remove UIDatePickerView, everything works.

Here's a sample project that exhibits this behavior: https://www.dropbox.com/s/fze7woen3dh2c72/UIDatePickerWithinStaticUITableView.zip?dl=0

Thanks!

--Dave

nativecss commented 9 years ago

Thanks for reporting this David, I've told the development team. If you want this fixed urgently I'd suggest upgrading to our basic support by emailing support@nativecss.com