Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-23858

iOS: getItems() on cleared Pasteboard errors and crashes

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 5.5.0
    • Fix Version/s: Release 5.5.0
    • Component/s: iOS
    • Labels:
    • Environment:

      MacOS 10.12 (16A239m)
      Studio 4.7.1.201608190732
      Ti SDK 5.5.0.v20160831204306
      Appc NPM 4.2.7
      Appc CLI 5.5.0-5
      Alloy 1.9.1
      Xcode 8.0 (8S201h)

    • Story Points:
      5
    • Sprint:
      2016 Sprint 18 SDK

      Description

      The getItems() method is throwing an error after data has been cleared or items in the Pasteboard are invalid:

      [ERROR] :  2016-09-01 06:35:19.000 PasteboardCheck[12358:22821338] -[_NSZeroData boundBridge:withKrollObject:]: unrecognized selector sent to instance 0x79e63d80
      [ERROR] :  Script Error {
      [ERROR] :      column = 39;
      [ERROR] :      line = 58;
      [ERROR] :      message = "-[_NSZeroData boundBridge:withKrollObject:]: unrecognized selector sent to instance 0x79e63d80";
      [ERROR] :      stack = "[native code]\n";
      [ERROR] :  }
      

      Steps to reproduce issue
      1. Create a new project
      2. Add the below lines to the code, preferably on a button press:

      Ti.UI.Clipboard.clearData();
      alert(Ti.UI.Clipboard.getItems());
      

      3. Run the project and press the button or call the methods

      Expected results
      getItems() returns an empty array, without error

      Actual results
      The above error is thrown

      Notes
      This is stated in the docs for setItems(), but is there a way we can handle it better? Perhaps checking numberOfItems and using that to make sure the Pasteboard is not empty first?
      Although a runtime error is thrown, you can see an empty array returned from getItems() if you dismiss the error and call it again. However, If you clear the data with clearData() and then call getItems() too many times (sometimes 2), then the app will crash with the below error:

      [ERROR] :  The application has crashed with an uncaught exception 'NSInvalidArgumentException'.
      [ERROR] :  Reason:
      [ERROR] :  -[_NSZeroData unboundBridge:]: unrecognized selector sent to instance 0x79191700
      [ERROR] :  Stack trace:
      [ERROR] :  
      [ERROR] :  0   CoreFoundation                      0x06f851f0 __exceptionPreprocess + 160
      [ERROR] :  1   libobjc.A.dylib                     0x065fae66 objc_exception_throw + 52
      [ERROR] :  2   CoreFoundation                      0x06ffe3dc -[NSObject(NSObject) doesNotRecognizeSelector:] + 172
      [ERROR] :  3   CoreFoundation                      0x06f0434c ___forwarding___ + 1052
      [ERROR] :  4   CoreFoundation                      0x06f03f0e _CF_forwarding_prep_0 + 14
      [ERROR] :  5   PasteboardCheck                     0x00061d6e -[KrollBridge unregisterProxy:] + 158
      [ERROR] :  6   PasteboardCheck                     0x00070839 KrollFinalizer + 489
      [ERROR] :  7   PasteboardCheck                     0x0042c42c _ZN2TI20JSCallbackObjectData8finalizeENS_6HandleINS_7UnknownEEEPv + 108
      [ERROR] :  8   PasteboardCheck                     0x005fb4ae _ZN2TI9WeakBlock5sweepEv + 110
      [ERROR] :  9   PasteboardCheck                     0x005fd358 _ZN2TI7WeakSet5sweepEv + 40
      [ERROR] :  10  PasteboardCheck                     0x004eedbc _ZN2TI11MarkedBlock5sweepENS0_9SweepModeE + 28
      [ERROR] :  11  PasteboardCheck                     0x003c08fa _ZN2TI18IncrementalSweeper7doSweepEd + 154
      [ERROR] :  12  PasteboardCheck                     0x003c084b _ZN2TI18IncrementalSweeper6doWorkEv + 27
      [ERROR] :  13  PasteboardCheck                     0x003bf566 _ZN2TI9HeapTimer12timerDidFireEP16__CFRunLoopTimerPv + 166
      [ERROR] :  14  CoreFoundation                      0x06f115d6 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
      [ERROR] :  15  CoreFoundation                      0x06f110ed __CFRunLoopDoTimer + 1213
      [ERROR] :  16  CoreFoundation                      0x06f10bff __CFRunLoopDoTimers + 255
      [ERROR] :  17  CoreFoundation                      0x06f086c0 __CFRunLoopRun + 2208
      [ERROR] :  18  CoreFoundation                      0x06f07bab CFRunLoopRunSpecific + 395
      [ERROR] :  19  CoreFoundation                      0x06f07a0b CFRunLoopRunInMode + 123
      [ERROR] :  20  GraphicsServices                    0x08241b4c GSEventRunModal + 177
      [ERROR] :  21  GraphicsServices                    0x082419c7 GSEventRun + 80
      [ERROR] :  22  UIKit                               0x025480eb UIApplicationMain + 148
      [ERROR] :  23  PasteboardCheck                     0x000462e8 main + 408
      [ERROR] :  24  libdyld.dylib                       0x07d96799 start + 1
      [ERROR] :  25  ???                                 0x00000001 0x0 + 1
      [ERROR] :  
      [ERROR] :  2016-09-01 06:37:27.651 PasteboardCheck[12715:22825481] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_NSZeroData unboundBridge:]: unrecognized selector sent to instance 0x79191700'
      [ERROR] :  *** First throw call stack:
      [ERROR] :  (
      [ERROR] :  	0   CoreFoundation                      0x06f85212 __exceptionPreprocess + 194
      [ERROR] :  	1   libobjc.A.dylib                     0x065fae66 objc_exception_throw + 52
      [ERROR] :  	2   CoreFoundation                      0x06ffe3dc -[NSObject(NSObject) doesNotRecognizeSelector:] + 172
      [ERROR] :  	3   CoreFoundation                      0x06f0434c ___forwarding___ + 1052
      [ERROR] :  	4   CoreFoundation                      0x06f03f0e _CF_forwarding_prep_0 + 14
      [ERROR] :  	5   PasteboardCheck                     0x00061d6e -[KrollBridge unregisterProxy:] + 158
      [ERROR] :  	6   PasteboardCheck                     0x00070839 KrollFinalizer + 489
      [ERROR] :  	7   PasteboardCheck                     0x0042c42c _ZN2TI20JSCallbackObjectData8finalizeENS_6HandleINS_7UnknownEEEPv + 108
      [ERROR] :  	8   PasteboardCheck                     0x005fb4ae _ZN2TI9WeakBlock5sweepEv + 110
      [ERROR] :  	9   PasteboardCheck                     0x005fd358 _ZN2TI7WeakSet5sweepEv + 40
      [ERROR] :  	10  PasteboardCheck                     0x004eedbc _ZN2TI11MarkedBlock5sweepENS0_9SweepModeE + 28
      [ERROR] :  	11  PasteboardCheck                     0x003c08fa _ZN2TI18IncrementalSweeper7doSweepEd + 154
      [ERROR] :  	12  PasteboardCheck                     0x003c084b _ZN2TI18IncrementalSweeper6doWorkEv + 27
      [ERROR] :  	13  PasteboardCheck                     0x003bf566 _ZN2TI9HeapTimer12timerDidFireEP16__CFRunLoopTimerPv + 166
      [ERROR] :  	14  CoreFoundation                      0x06f115d6 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
      [ERROR] :  	15  CoreFoundation                      0x06f110ed __CFRunLoopDoTimer + 1213
      [ERROR] :  	16  CoreFoundation                      0x06f10bff __CFRunLoopDoTimers + 255
      [ERROR] :  	17  CoreFoundation                      0x06f086c0 __CFRunLoopRun + 2208
      [ERROR] :  	18  CoreFoundation                      0x06f07bab CFRunLoopRunSpecific + 395
      [ERROR] :  	19  CoreFoundation                      0x06f07a0b CFRunLoopRunInMode + 123
      [ERROR] :  	20  GraphicsServices                    0x08241b4c GSEventRunModal + 177
      [ERROR] :  	21  GraphicsServices                    0x082419c7 GSEventRun + 80
      [ERROR] :  	22  UIKit                               0x025480eb UIApplicationMain + 148
      [ERROR] :  	23  PasteboardCheck                     0x000462e8 main + 408
      [ERROR] :  	24  libdyld.dylib                       0x07d96799 start + 1
      [ERROR] :  	25  ???                                 0x00000001 0x0 + 1
      [ERROR] :  )
      [ERROR] :  libc++abi.dylib: terminating with uncaught exception of type NSException
      [TRACE] :  [PasteboardCheck] -[_NSZeroData unboundBridge:]: unrecognized selector sent to instance 0x79191700
      [TRACE] :  [PasteboardCheck] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_NSZeroData unboundBridge:]: unrecognized selector sent to instance 0x79191700'
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hknoechel Hans Knöchel
                Reporter:
                ewieber Eric Wieber (Inactive)
                Reviewer:
                Chee Kiat Ng (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-10065
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration