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

iOS: ListView crashes on setting accessoryType after filtering on itemclick event

    Details

      Description

      Problem description

      listview crashes on setting accessoryType after filtering on itemclick event. But its working well without filtering data in ListView .

      Testing Environment

      MAC OS X 10.8.5
      Ti SDK 3.2.0.GA
      Ti CLI 3.2.0
      IOS Simulator 7.0.3

      Test Code

      var win = Ti.UI.createWindow({
      	backgroundColor : 'white'
      });
       
      var tasks = [{
      	id : 'trash',
      	name : 'Take Out the Trash',
      }, {
      	id : 'dishes',
      	name : 'Do the Dishes',
      }, {
      	id : 'doggie',
      	name : 'Walk the Dog',
      }];
       
      var data = [];
      for (var i = 0; i < tasks.length; i++) {
      	data.push({
      		properties : {
      			itemId : tasks[i].id,
      			title : tasks[i].name,
      			searchableText : tasks[i].name,
      			accessoryType : Ti.UI.LIST_ACCESSORY_TYPE_NONE,
      			color : 'black'
      		}
      	});
      }
       
      var search = Titanium.UI.createSearchBar({
      	barColor : '#000',
      	showCancel : true,
      	height : 43,
      	top : 0,
      });
       
      var section = Ti.UI.createListSection();
      section.setItems(data);
       
      var listView = Ti.UI.createListView({
      	top : 25,
      	searchView : search,
      	sections : [section],
      	caseInsensitiveSearch : false
      });
       
      listView.addEventListener('itemclick', function(e) {
      	var item = section.getItemAt(e.itemIndex);
      	item.properties.accessoryType = Ti.UI.LIST_ACCESSORY_TYPE_CHECKMARK;
      	section.updateItemAt(e.itemIndex, item);
      });
      win.add(listView);
      win.open();
      

      Step to reproduces
      1. Run this code in IOS Simulator
      2. Filter on list view
      3. Click on list item
      4. App will crash
      Expected Result

      App will not crash

      Thanks

        Attachments

        1. ios6.crash
          31 kB
          Wilson Luu
        2. ios7.crash
          34 kB
          Wilson Luu

          Activity

            People

            • Assignee:
              vduggal Vishal Duggal (Inactive)
              Reporter:
              mrahman Mostafizur Rahman
              Reviewer:
              Sabil Rahim
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration