{ "id": "116109", "key": "TIMOB-14292", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "15576", "description": "2013 Sprint 16", "name": "2013 Sprint 16", "archived": true, "released": true, "releaseDate": "2013-08-12" }, { "id": "15578", "description": "2013 Sprint 16 API", "name": "2013 Sprint 16 API", "archived": true, "released": true, "releaseDate": "2013-08-12" }, { "id": "15479", "description": "Release 3.1.2", "name": "Release 3.1.2", "archived": true, "released": true, "releaseDate": "2013-07-31" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-08-02T20:33:40.000+0000", "created": "2013-06-18T10:05:56.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "ios", "qe-testadded", "regression", "searchbar", "tableview" ], "versions": [ { "id": "15478", "description": "Release 3.1.1", "name": "Release 3.1.1", "archived": true, "released": true, "releaseDate": "2013-06-17" } ], "issuelinks": [ { "id": "31166", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "118684", "key": "TIMOB-14900", "fields": { "summary": "iOS7 simulator only: Application has exited from iOS Simulator on a \"second time\" Window creation", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2013-08-21T10:37:47.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "*Problem*\r\nThe iPhone version of my app is crashing. This happens with Ti 3.1.0 but not with 3.0.2. The view consists of a window containing a table view and a search bar. when the window opens a request is sent to the server and data is retrieved to populate the tableview. When any row is clicked the window closes and the value of the row is returned. The crash happens when I click on any row resulting from search bar filtering.\r\n\r\n*Test case*\r\n{code:javascript}\r\nvar win1 = Ti.UI.createWindow({\r\n\tbackgroundColor : \"#FFF\"\r\n});\r\n\r\nvar wins = Ti.UI.createWindow({\r\n\tbackgroundColor : 'white'\r\n});\r\n\r\nvar nav = Titanium.UI.iPhone.createNavigationGroup({\r\n\twindow : wins\r\n});\r\n\r\nvar btn = Ti.UI.createButton({\r\n\ttitle : 'click'\r\n});\r\n\r\nbtn.addEventListener('click', function(e) {\r\n\tvar win = Titanium.UI.createWindow({\r\n\t\tbackgroundColor : 'white'\r\n\t});\r\n\tvar search = Titanium.UI.createSearchBar({\r\n\t\tshowCancel : true,\r\n\t\theight : 43,\r\n\t\ttop : 0\r\n\t});\r\n\tvar data = [];\r\n\r\n\tdata[0] = Titanium.UI.createTableViewSection({\r\n\t\theaderTitle : 'Header 1'\r\n\t});\r\n\tdata[0].add(Titanium.UI.createTableViewRow({\r\n\t\ttitle : 'Row 1'\r\n\t}));\r\n\r\n\tdata[1] = Titanium.UI.createTableViewSection({\r\n\t\theaderTitle : 'Header 2'\r\n\t});\r\n\tdata[1].add(Titanium.UI.createTableViewRow({\r\n\t\ttitle : 'Row 2'\r\n\t}));\r\n\r\n\tsearch.addEventListener('focus', function(e) {\r\n\t\tTi.API.info('focus');\r\n\t});\r\n\r\n\tvar tableview = Titanium.UI.createTableView({\r\n\t\tdata : data,\r\n\t\tsearch : search,\r\n\r\n\t});\r\n\r\n\ttableview.addEventListener('click', function(e) {\r\n\t\tTi.API.info(e);\r\n\t\tnav.close(win);\r\n\t});\r\n\r\n\twin.add(tableview);\r\n\r\n\tnav.open(win);\r\n});\r\n\r\nwins.add(btn);\r\n\r\nwin1.add(nav);\r\nwin1.open();\r\n{code}\r\n\r\n*Log*\r\n{code}\r\n[ERROR] : The application has crashed with an uncaught exception 'NSInternalInconsistencyException'.\r\n[ERROR] : Reason:\r\n[ERROR] : attempt to insert row 0 into section 0, but there are only 0 rows in section 0 after the update\r\n[ERROR] : Stack trace:\r\n[ERROR] : 0 CoreFoundation 0x038d3012 __exceptionPreprocess + 178\r\n[ERROR] : 1 libobjc.A.dylib 0x03394e7e objc_exception_throw + 44\r\n[ERROR] : 2 CoreFoundation 0x038d2e78 +[NSException raise:format:arguments:] + 136\r\n[ERROR] : 3 Foundation 0x00e6af35 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116\r\n[ERROR] : 4 UIKit 0x01250ec7 -[UITableView(_UITableViewPrivate) _endCellAnimationsWithContext:] + 6056\r\n[ERROR] : 5 UIKit 0x0125f846 -[UITableView _updateRowsAtIndexPaths:updateAction:withRowAnimation:] + 337\r\n[ERROR] : 6 UIKit 0x0125f908 -[UITableView reloadRowsAtIndexPaths:withRowAnimation:] + 66\r\n[ERROR] : 7 Orderoso 0x000c3f15 -[TiUITableView hideSearchScreen:] + 661\r\n[ERROR] : 8 Foundation 0x00dd2e83 __NSFireDelayedPerform + 380\r\n[ERROR] : 9 CoreFoundation 0x03892376 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22\r\n[ERROR] : 10 CoreFoundation 0x03891e06 __CFRunLoopDoTimer + 534\r\n[ERROR] : 11 CoreFoundation 0x03879a82 __CFRunLoopRun + 1810\r\n[ERROR] : 12 CoreFoundation 0x03878f44 CFRunLoopRunSpecific + 276\r\n[ERROR] : 13 CoreFoundation 0x03878e1b CFRunLoopRunInMode + 123\r\n[ERROR] : 14 GraphicsServices 0x0365a7e3 GSEventRunModal + 88\r\n[ERROR] : 15 GraphicsServices 0x0365a668 GSEventRun + 104\r\n[ERROR] : 16 UIKit 0x011b165c UIApplicationMain + 1211\r\n[ERROR] : 17 Orderoso 0x00004198 main + 456\r\n[ERROR] : 18 Orderoso 0x00002ac5 start + 53\r\n[ERROR] : 2013-06-12 23:15:44.835 Orderoso[6411:c07] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'attempt to insert row 0 into section 0, but there are only 0 rows in section 0 after the update'\r\n[ERROR] : *** First throw call stack:\r\n[ERROR] : (0x38d3012 0x3394e7e 0x38d2e78 0xe6af35 0x1250ec7 0x125f846 0x125f908 0xc3f15 0xdd2e83 0x3892376 0x3891e06 0x3879a82 0x3878f44 0x3878e1b 0x365a7e3 0x365a668 0x11b165c 0x4198 0x2ac5)\r\n{code}\r\n\r\nI found the cause of crash. it is this line in TiUITableView.m which delays hiding the search bar for 200 ms, when I am closing the window immediately.\r\n{code}\r\n[self performSelector:@selector(hideSearchScreen:) withObject:nil afterDelay:0.2];\r\n{code}\r\n\r\n*Workaround*\r\nDelay closing the window.\r\n\r\nPlease check the comment at: https://github.com/appcelerator/titanium_mobile/commit/594bee84c41b352996d6dcf7a304f1e9ae32af67#commitcomment-3446266", "attachment": [], "flagged": false, "summary": "iOS: TableView crashing after clicking on SearchBar-filtered row", "creator": { "name": "hini", "key": "hini", "displayName": "Hani Hamadeh", "active": true, "timeZone": "Asia/Beirut" }, "subtasks": [], "reporter": { "name": "hini", "key": "hini", "displayName": "Hani Hamadeh", "active": true, "timeZone": "Asia/Beirut" }, "environment": "iOS Ti v3.1.0 and above", "comment": { "comments": [ { "id": "258430", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Hani,\r\n\r\nBefore I can escalate this please could you provide a simple reproducible test case which can be dropped into an app.js?\r\n\r\nThanks!", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-18T18:20:39.000+0000", "updated": "2013-06-18T18:20:39.000+0000" }, { "id": "258442", "author": { "name": "hini", "key": "hini", "displayName": "Hani Hamadeh", "active": true, "timeZone": "Asia/Beirut" }, "body": "You're lucky :P\r\nI was able to reproduce it in a simple example.\r\n\r\n[moved to description]", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-18T19:15:22.000+0000", "updated": "2013-06-19T17:55:29.000+0000" }, { "id": "258567", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested and confirmed on iOS 6 simulator with Ti SDK 3.1.1 GA.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-19T17:57:23.000+0000", "updated": "2013-06-19T17:57:23.000+0000" }, { "id": "264676", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending against master\r\nhttps://github.com/appcelerator/titanium_mobile/pull/4516", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-08-02T16:21:45.000+0000", "updated": "2013-08-02T16:21:45.000+0000" }, { "id": "264829", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Backport to 3_1_X\nhttps://github.com/appcelerator/titanium_mobile/pull/4536", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-08-02T22:23:31.000+0000", "updated": "2013-08-02T22:23:31.000+0000" }, { "id": "266693", "author": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix & the app does not crash after immediately closing the window when we select the search filtered row.\r\nThus closing.\r\n\r\nEnvironment:\r\nAppcel Studio : 3.1.2.201308091728\r\nTi SDK : 3.1.2.v20130814124556\r\nMac OSX : 10.8.4\r\nAlloy : 1.2.0-beta\r\nCLI - 3.1.2-alpha\r\nIpad4 - 6.0.1\r\nIphone5 - 6.0", "updateAuthor": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-08-15T17:23:05.000+0000", "updated": "2013-08-15T17:23:05.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }