Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16381] iOS: ListView crashes on setting accessoryType after filtering on itemclick event

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-08-05T02:58:33.000+0000
Affected Version/sRelease 3.2.0, Release 3.2.1
Fix Version/s2014 Sprint 03, 2014 Sprint 03 API, Release 3.2.2, Release 3.3.0
ComponentsiOS
Labelsmodule_listview, qe-3.2.1, qe-manualtest, supportTeam, triage
ReporterMostafizur Rahman
AssigneeVishal Duggal
Created2014-02-05T08:39:21.000+0000
Updated2014-08-05T02:58:33.000+0000

Description

Problem description

listview crashes on setting accessoryType after filtering on itemclick event. But its working well without filtering data in [ListView ](http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.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

Run this code in IOS Simulator

Filter on list view

Click on list item

App will crash

Expected Result

App will not crash Thanks

Attachments

FileDateSize
ios6.crash2014-02-05T19:07:20.000+000032005
ios7.crash2014-02-05T19:07:20.000+000035044

Comments

  1. Wilson Luu 2014-02-05

    Was able to reproduce this issue on both an iOS 6 and 7 devices. Also, this issue appears in both SDK build 3.2.0.GA and latest 3.2.1. *Tested on:* Appcelerator Studio, build: 3.2.1.201402041206 SDK build: 3.2.0.GA, 3.2.1.v20140203174850 CLI: 3.2.1-beta3 Alloy: 1.3.1-cr2 Xcode: 5.0.2 Devices: iphone 5 (7.0.2), iphone 4s (6.0.1) *Note:* 1. If trying to reproduce on iOS 7 devices, filter for the second or third item, then select the filtered item. The crash *will not* appear if you filter for the first item. 2. If trying to reproduce on iOS 6 device, filter *any* items, then select the item. The crash will appear regardless which item you filtered. 3. Attached my crash logs; ios6.crash and ios7.crash
  2. Vishal Duggal 2014-02-05

    Pull pending master - https://github.com/appcelerator/titanium_mobile/pull/5324 3_2_X - https://github.com/appcelerator/titanium_mobile/pull/5325
  3. Wilson Luu 2014-02-24

    Closing ticket as fixed. Verified ListView does not crash after selecting a filtered list item. Tested on: Appcelerator Studio, build: 3.2.1.201402061120 SDK build: 3.2.2.v20140221161255, 3.3.0.v20140224114904 CLI: 3.2.1 Alloy: 1.3.1 Xcode: 5.0.2, 5.1 beta 5 Devices: iphone 4s (6.0.1), iphone 4 (7.0.6), iphone 5 (7.1)

JSON Source