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

iOS: Crash when selecting filtered row in Ti.UI.SearchBar

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Release 6.3.0
    • Fix Version/s: Release 7.0.1
    • Component/s: iOS
    • Environment:

      Description

      Hi, i have a problem with selecting a filtered row in a tableview.
      The app crashes, when i try to change the background color of the clicked row.
      This happens only when in tiapp.xml run-on-main-thread is set to true.
      Example (Just click on a filtered row):

      Ti.UI.backgroundColor = 'white';
      var win = Ti.UI.createWindow();
      var view = Titanium.UI.createView(

      { top:30, width:400, left:150, }

      );
      var oldRow;
      var tableData = [

      {title: 'Apples'}

      ,

      {title: 'Bananas'}

      ,

      {title: 'Carrots'}

      ,

      {title: 'Potatoes'}

      ];
      var searchBar = Titanium.UI.createSearchBar(

      { showCancel:true, }

      );
      var table = Ti.UI.createTableView(

      { data: tableData, search:searchBar, width:300, hideSearchOnSelection:false }

      );

      table.addEventListener('click', function(e)

      { if (oldRow != null) oldRow.backgroundColor = 'white'; e.row.backgroundColor = '#E6E6E6'; oldRow = e.row; }

      );
      view.add(table);
      win.add(view);
      win.open();

      [ERROR] : The application has crashed with an uncaught exception 'NSInternalInconsistencyException'.
      [ERROR] : Reason:
      [ERROR] : attempt to insert row 3 into section 0, but there are only 2 rows in section 0 after the update
      [ERROR] : Stack trace:
      [ERROR] : 0 CoreFoundation 0x0000000114653193 __exceptionPreprocess + 147
      [ERROR] : 1 libobjc.A.dylib 0x0000000113720f41 objc_exception_throw + 48
      [ERROR] : 2 CoreFoundation 0x0000000114658372 +[NSException raise:format:arguments:] + 98
      [ERROR] : 3 Foundation 0x000000010df8c089 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
      [ERROR] : 4 UIKit 0x000000010e62ded7 -[UITableView _endCellAnimationsWithContext:] + 9203
      [ERROR] : 5 UIKit 0x000000010e64c2e4 -[UITableView _updateRowsAtIndexPaths:withUpdateAction:rowAnimation:usingPresentationValues:] + 1342
      [ERROR] : 6 UIKit 0x000000010e64c69d -[UITableView reloadRowsAtIndexPaths:withRowAnimation:] + 133
      [ERROR] : 7 test 0x000000010c460463 -[TiUITableView dispatchAction:] + 771
      [ERROR] : 8 test 0x000000010c520341 -[TiUITableViewRowProxy updateRow:] + 97
      [ERROR] : 9 test 0x000000010c5204da __41-[TiUITableViewRowProxy triggerRowUpdate]_block_invoke + 42
      [ERROR] : 10 libdispatch.dylib 0x00000001178f7273 _dispatch_call_block_and_release + 12
      [ERROR] : 11 libdispatch.dylib 0x00000001178f82b5 _dispatch_client_callout + 8
      [ERROR] : 12 libdispatch.dylib 0x0000000117902496 _dispatch_main_queue_callback_4CF + 1260
      [ERROR] : 13 CoreFoundation 0x0000000114615ee9 _CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE_ + 9
      [ERROR] : 14 CoreFoundation 0x00000001145da592 __CFRunLoopRun + 2402
      [ERROR] : 15 CoreFoundation 0x00000001145d99b9 CFRunLoopRunSpecific + 409
      [ERROR] : 16 GraphicsServices 0x00000001163d09c6 GSEventRunModal + 62
      [ERROR] : 17 UIKit 0x000000010e50d5e8 UIApplicationMain + 159
      [ERROR] : 18 test 0x000000010c3bed54 main + 100
      [ERROR] : 19 libdyld.dylib 0x000000011796cd81 start + 1
      [ERROR] : 20 ??? 0x0000000000000001 0x0 + 1
      – End simulator log ---------------------------------------------------------

        Attachments

          Activity

            People

            • Assignee:
              vijaysingh Vijay Singh
              Reporter:
              mlandeck Michael Landeck
              Reviewer:
              Hans Knöchel
              Tester:
              Eric Wieber
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code