[TIMOB-16431] iOS/Android: Updating ListItem of ListView displayed after Search crashes app
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2016-04-27T10:37:14.000+0000 |
Affected Version/s | Release 3.2.0 |
Fix Version/s | Release 5.2.0 |
Components | iOS |
Labels | android, ios, listitem, listview |
Reporter | Young |
Assignee | Chee Kiat Ng |
Created | 2014-01-18T18:03:50.000+0000 |
Updated | 2016-04-27T10:37:38.000+0000 |
Description
App (iOS & Android) crashes when clickHandler of ListView updates ListItem when list being displayed as Search Result.
To reproduce the error:
1. add the following code to list_v2_search_searchview.js of Kitchen Sink:
e.section.updateItemAt(e.itemIndex, {
properties: { title: 'Will crash app' }
});
2. do a search (with result)
3. click on any row of the search result (list view)
4. *app crash*
Modified Kitchen Sink code:
function clickHandler(e){
var message = 'Type:'+e.type+'\nSection title:'+e.section.headerTitle+'\nsectionIndex:'+e.sectionIndex+'\nitemIndex:'+e.itemIndex;
if(isValidVar(e.bindId)){
message += '\nbindId:'+e.bindId;
}
if(isValidVar(e.itemId)){
message += '\nitemId:'+e.itemId;
}
alert(message);
e.section.updateItemAt(e.itemIndex, {
properties: { title: 'Will crash app' }
});
}
I tested this issue with the test code below. I can't reproduce this issue. Can you please do a quick test using the code below to see if you can reproduce the error. If so, please let us know.
Test Environment
Mac OX S 10.8.5 Ti SDK 3.2.0.GA Ti CLI 3.2.0 IOS simulator 7.0.3Test Code
Step to Test
Create a simple project
Update app.js with my test code
Run on iOS simulator for testing
Do a search (with result)
Click on any row of the search result (list view)
Test Result
App is running with out any crash ThanksI am experiencing the same issue. A simple project using Mostafizur Rahman's code also crashes as soon as I click an item in the search results. Code crashes in 3.2.0GA as well as 3.2.1. Ran the project in XCode and the crash occurs in TiUIListview.m, on this line: -(void)buildResultsForSearchText { searchActive = ([searchString length] > 0); >> EXC_BAD_ACCESS I will try to hack fix it, but I hope you can find a real fix soon.
Moving this ticket to engineering as I can reproduce this issue with the following test case on iOS platform. It appears related to TC-3682 (crash with deleteItemsAt) whereas this crash is with updateItemAt.
Hey guys, could you try using the latest 5.2.2.GA for this issue? I remember we fixed something related for that release. Thank you! *EDIT*: Using the below code (refactored from above), it does not crash when clicking an item while the search is focussed:
Closing for now. If you still experience it, feel free to comment here!