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

iOS: Crash if all results from search in ListView fit on view

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 3.4.1, Release 3.5.0
    • Fix Version/s: Release 3.5.0, Release 4.0.0
    • Component/s: iOS
    • Environment:

      Titanium SDK 3.5.0.v20150108020917
      Studio 3.4.1.201410281743
      Xcode 6.1.1

      On:
      iPad mini, iOS 8.1

      Description

      App crashes when filtering results in a ListView, that is in a popover, if the number of items filtered is less then needed to fill the few height of the listview.
      This is not a regression as it also occurs with 3.4.1.GA.

      Steps to reproduce issue:
      1. Tap the button to open the popover
      2. Tap the searchbar and enter "odd"
      3. Hide the soft keyboard using the dedicated button on the soft keyboard
      4. App crashes

      Expected Results:
      able to search or dismiss keyboard without crash

      Actual Results:
      App crashes with below error

      Notes:
      I've found that it only happens if the number of items filtered is less then needed to fill the few height of the listview. If you increase the number of items to 50 you won't be able to replicate.

      var w = Ti.UI.createWindow({
        backgroundColor: 'white'
      });
       
      var b = Ti.UI.createButton({
        title: 'Click Me'
      });
       
      b.addEventListener('click', function() {
       
        var cw = Ti.UI.createWindow({
          width: 300
        });
       
        var items = [];
       
        for (var i = 1, oe; i <= 20; i++) {
          oe = (i % 2 === 0) ? 'even' : 'odd';
          items.push({
            properties: {
              title: 'Row #' + i + ' (' + oe + ')',
              searchableText: oe
            }
          });
        }
       
        var lv = Ti.UI.createListView({
          searchView: Ti.UI.createSearchBar(),
          sections: [Ti.UI.createListSection({
            items: items
          })]
        });
       
        cw.add(lv);
       
        var p = Ti.UI.iPad.createPopover({
          contentView: cw
        });
       
        p.show({
          view: b
        });
      });
       
      w.add(b);
      w.open();
      

      Error thrown is a Range Exception; beyond bounds:

      [ERROR] :  The application has crashed with an uncaught exception 'NSRangeException'.
      [ERROR] :  Reason:
      [ERROR] :  *** -[__NSArrayM objectAtIndex:]: index 16 beyond bounds [0 .. 9]
      [ERROR] :  Stack trace:
      [ERROR] :  
      [ERROR] :  0   CoreFoundation                      0x0000000183225e48 <redacted> + 132
      [ERROR] :  1   libobjc.A.dylib                     0x0000000193ce40e4 objc_exception_throw + 60
      [ERROR] :  2   CoreFoundation                      0x000000018310b77c <redacted> + 0
      [ERROR] :  3   00 Classic Test                     0x0000000100160fa4 00 Classic Test + 1347492
      [ERROR] :  4   00 Classic Test                     0x00000001001675d4 00 Classic Test + 1373652
      [ERROR] :  5   UIKit                               0x0000000187ccb14c <redacted> + 544
      [ERROR] :  6   UIKit                               0x0000000187cbfd00 <redacted> + 2360
      [ERROR] :  7   UIKit                               0x0000000187aa7888 <redacted> + 224
      [ERROR] :  8   UIKit                               0x0000000187aa7758 <redacted> + 1020
      [ERROR] :  9   UIKit                               0x0000000187aa696c <redacted> + 276
      [ERROR] :  10  UIKit                               0x00000001879eacd4 <redacted> + 600
      [ERROR] :  11  UIKit                               0x00000001880c88e8 <redacted> + 56
      [ERROR] :  12  CoreFoundation                      0x000000018311cff0 <redacted> + 132
      [ERROR] :  13  CoreFoundation                      0x000000018311ce94 <redacted> + 248
      [ERROR] :  14  UIKit                               0x00000001879da478 <redacted> + 132
      [ERROR] :  15  UIKit                               0x00000001879ce07c <redacted> + 476
      [ERROR] :  16  00 Classic Test                     0x0000000100075504 00 Classic Test + 382212
      [ERROR] :  17  UIKit                               0x00000001879eacd4 <redacted> + 600
      [ERROR] :  18  CoreFoundation                      0x000000018311cff0 <redacted> + 132
      [ERROR] :  19  CoreFoundation                      0x000000018311ce94 <redacted> + 248
      [ERROR] :  20  UIKit                               0x00000001879da478 <redacted> + 132
      [ERROR] :  21  UIKit                               0x00000001879ce07c <redacted> + 476
      [ERROR] :  22  00 Classic Test                     0x0000000100075504 00 Classic Test + 382212
      [ERROR] :  23  UIKit                               0x00000001879eacd4 <redacted> + 600
      [ERROR] :  24  CoreFoundation                      0x000000018311cff0 <redacted> + 132
      [ERROR] :  25  CoreFoundation                      0x000000018311ce94 <redacted> + 248
      [ERROR] :  26  UIKit                               0x00000001879da478 <redacted> + 132
      [ERROR] :  27  UIKit                               0x00000001879ce07c <redacted> + 476
      [ERROR] :  28  UIKit                               0x00000001879eacd4 <redacted> + 600
      [ERROR] :  29  CoreFoundation                      0x000000018311cff0 <redacted> + 132
      [ERROR] :  30  CoreFoundation                      0x000000018311ce94 <redacted> + 248
      [ERROR] :  31  UIKit                               0x00000001879da478 <redacted> + 132
      [ERROR] :  32  UIKit                               0x00000001879ce07c <redacted> + 476
      [ERROR] :  33  UIKit                               0x0000000187c2a880 <redacted> + 152
      [ERROR] :  34  UIKit                               0x00000001879d1a2c <redacted> + 572
      [ERROR] :  35  QuartzCore                          0x0000000187329994 <redacted> + 168
      [ERROR] :  36  QuartzCore                          0x0000000187324564 <redacted> + 320
      [ERROR] :  37  UIKit                               0x00000001879e5e10 <redacted> + 160
      [ERROR] :  38  UIKit                               0x00000001879ce118 <redacted> + 632
      [ERROR] :  39  UIKit                               0x0000000187c2ba20 <redacted> + 684
      [ERROR] :  40  UIKit                               0x0000000187a09464 <redacted> + 508
      [ERROR] :  41  UIKit                               0x0000000187a210b4 <redacted> + 68
      [ERROR] :  42  UIKit                               0x000000018810ede8 <redacted> + 376
      [ERROR] :  43  Foundation                          0x00000001840e84a8 __NSFireDelayedPerform + 424
      [ERROR] :  44  CoreFoundation                      0x00000001831ddfd4 <redacted> + 28
      [ERROR] :  45  CoreFoundation                      0x00000001831ddc84 <redacted> + 888
      [ERROR] :  46  CoreFoundation                      0x00000001831db6d0 <redacted> + 1372
      [ERROR] :  47  CoreFoundation                      0x00000001831091f4 CFRunLoopRunSpecific + 396
      [ERROR] :  48  GraphicsServices                    0x000000018c2735a4 GSEventRunModal + 168
      [ERROR] :  49  UIKit                               0x0000000187a3a784 UIApplicationMain + 1488
      [ERROR] :  50  00 Classic Test                     0x000000010001d48c 00 Classic Test + 21644
      [ERROR] :  51  libdyld.dylib                       0x0000000194352a08 <redacted> + 4
      [ERROR] :  *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 16 beyond bounds [0 .. 9]'
      [ERROR] :  *** First throw call stack:
      [ERROR] :  (0x183225e48 0x193ce40e4 0x18310b77c 0x100160fa4 0x1001675d4 0x187ccb14c 0x187cbfd00 0x187aa7888 0x187aa7758 0x187aa696c 0x1879eacd4 0x1880c88e8 0x18311cff0 0x18311ce94 0x1879da478 0x1879ce07c 0x100075504 0x1879eacd4 0x18311cff0 0x18311ce94 0x1879da478 0x1879ce07c 0x100075504 0x1879eacd4 0x18311cff0 0x18311ce94 0x1879da478 0x1879ce07c 0x1879eacd4 0x18311cff0 0x18311ce94 0x1879da478 0x1879ce07c 0x187c2a880 0x1879d1a2c 0x187329994 0x187324564 0x1879e5e10 0x1879ce118 0x187c2ba20 0x187a09464 0x187a210b4 0x18810ede8 0x1840e84a8 0x1831ddfd4 0x1831ddc84 0x1831db6d0 0x1831091f4 0x18c2735a4 0x187a3a784 0x10001d48c 0x194352a08)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                penrique Pedro Enrique (Inactive)
                Reporter:
                ewieber Eric Wieber (Inactive)
                Reviewer:
                Jon Alter
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration