{ "id": "141919", "key": "TIMOB-18280", "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": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2017-11-21T01:01:32.000+0000", "created": "2014-12-19T09:39:16.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "keyboard", "listview", "popover", "searchview" ], "versions": [], "issuelinks": [], "assignee": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "updated": "2017-11-21T01:01:32.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": [], "description": "When you have used a SearchBar to filter out all items in a ListView that then resizes because it is contained in a Popover that resizes because the soft keyboard hides, the app crashes.\r\n\r\n*NOTE:* This issue looks very similar to TIMOB-18260, but the fix for that bug doesn't fix this bug and the stack trace is very different as well.\r\n\r\nLooking at this stack trace the issue seems to be related with resizing the list and containing it in a Popover is just a typical situation where this happens.\r\n\r\nThe actual exception is:\r\n\r\n{code}\r\n*** Terminating app due to uncaught exception 'NSRangeException', reason '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'\r\n{code}\r\n\r\nh1. Test Case\r\n\r\nRun an app with the following code on an iPad. Best is to use a device with no hardware keyboard. In Simulator you need to use Cmd+K at first to bring up the soft keyboard.\r\n\r\n1. Tap the button to open the popover.\r\n2. Tap the searchbar to bring up the soft keyboard, resizing the popover and list view.\r\n3. Search for anything to filter out all items (since they don't have a {{searchableText}}.\r\n4. Hit *Search* or the dedicated key to hide the soft keyboard.\r\n5. See the app crash soon after.\r\n\r\n{code:javascript}\r\nvar w = Ti.UI.createWindow({\r\n backgroundColor: 'white'\r\n});\r\n\r\nvar b = Ti.UI.createButton({\r\n title: 'Click Me'\r\n});\r\n\r\nb.addEventListener('click', function() {\r\n\r\n var cw = Ti.UI.createWindow({\r\n width: 300\r\n });\r\n\r\n var items = [];\r\n\r\n for (var i = 1; i <= 50; i++) {\r\n items.push({\r\n properties: {\r\n title: 'Row #' + i\r\n }\r\n });\r\n }\r\n\r\n var lv = Ti.UI.createListView({\r\n searchView: Ti.UI.createSearchBar(),\r\n sections: [Ti.UI.createListSection({\r\n items: items\r\n })]\r\n });\r\n\r\n cw.add(lv);\r\n\r\n var p = Ti.UI.iPad.createPopover({\r\n contentView: cw\r\n });\r\n\r\n p.show({\r\n view: b\r\n });\r\n});\r\n\r\nw.add(b);\r\nw.open();\r\n{code}\r\n\r\nh1. Console log\r\n\r\n{code}\r\n[ERROR] The application has crashed with an uncaught exception 'NSRangeException'.\r\n[ERROR] Reason:\r\n[ERROR] *** -[__NSArrayM objectAtIndex:] index 0 beyond bounds for empty array\r\n[ERROR] Stack trace:\r\n[ERROR]\r\n[ERROR] 0 CoreFoundation 0x2c79549f + 126\r\n[ERROR] 1 libobjc.A.dylib 0x3a21dc8b objc_exception_throw + 38\r\n[ERROR] 2 CoreFoundation 0x2c6a99e1 + 0\r\n[ERROR] 3 listresize 0x001f0fa9 listresize + 1347497\r\n[ERROR] 4 listresize 0x001f73dd listresize + 1373149\r\n[ERROR] 5 UIKit 0x2ff1d787 + 474\r\n[ERROR] 6 UIKit 0x2ff1d84b + 54\r\n[ERROR] 7 UIKit 0x2ff12fa1 + 2268\r\n[ERROR] 8 UIKit 0x2fd1d927 + 226\r\n[ERROR] 9 UIKit 0x2fd1d803 + 1098\r\n[ERROR] 10 UIKit 0x2fd1ca59 + 264\r\n[ERROR] 11 UIKit 0x2fc6c491 + 808\r\n[ERROR] 12 UIKit 0x2fc6c15b + 258\r\n[ERROR] 13 UIKit 0x302b35f7 + 42\r\n[ERROR] 14 CoreFoundation 0x2c6bc48f + 86\r\n[ERROR] 15 CoreFoundation 0x2c6bc38b + 202\r\n[ERROR] 16 UIKit 0x2fc5cc7b + 118\r\n[ERROR] 17 UIKit 0x2fc521bb + 530\r\n[ERROR] 18 listresize 0x00105bc9 listresize + 383945\r\n[ERROR] 19 UIKit 0x2fc6c491 + 808\r\n[ERROR] 20 UIKit 0x2fc6c15b + 258\r\n[ERROR] 21 CoreFoundation 0x2c6bc48f + 86\r\n[ERROR] 22 CoreFoundation 0x2c6bc38b + 202\r\n[ERROR] 23 UIKit 0x2fc5cc7b + 118\r\n[ERROR] 24 UIKit 0x2fc521bb + 530\r\n[ERROR] 25 listresize 0x00105bc9 listresize + 383945\r\n[ERROR] 26 UIKit 0x2fc6c491 + 808\r\n[ERROR] 27 UIKit 0x2fc6c15b + 258\r\n[ERROR] 28 CoreFoundation 0x2c6bc48f + 86\r\n[ERROR] 29 CoreFoundation 0x2c6bc38b + 202\r\n[ERROR] 30 UIKit 0x2fc5cc7b + 118\r\n[ERROR] 31 UIKit 0x2fc521bb + 530\r\n[ERROR] 32 UIKit 0x2fc6c491 + 808\r\n[ERROR] 33 UIKit 0x2fc6c15b + 258\r\n[ERROR] 34 CoreFoundation 0x2c6bc48f + 86\r\n[ERROR] 35 CoreFoundation 0x2c6bc38b + 202\r\n[ERROR] 36 UIKit 0x2fc5cc7b + 118\r\n[ERROR] 37 UIKit 0x2fc521bb + 530\r\n[ERROR] 38 UIKit 0x2fe87087 + 218\r\n[ERROR] 39 UIKit 0x2fc5524f + 514\r\n[ERROR] 40 QuartzCore 0x2f67da0d + 136\r\n[ERROR] 41 QuartzCore 0x2f6793e5 + 360\r\n[ERROR] 42 UIKit 0x2fc67987 + 138\r\n[ERROR] 43 UIKit 0x2fc52267 + 702\r\n[ERROR] 44 UIKit 0x2fe88209 + 784\r\n[ERROR] 45 UIKit 0x302f5317 + 110\r\n[ERROR] 46 UIKit 0x2fc88d63 + 482\r\n[ERROR] 47 UIKit 0x2fc9e8fd + 64\r\n[ERROR] 48 UIKit 0x302f5211 + 372\r\n[ERROR] 49 Foundation 0x2d49af99 __NSFireDelayedPerform + 468\r\n[ERROR] 50 CoreFoundation 0x2c75bc87 + 14\r\n[ERROR] 51 CoreFoundation 0x2c75b803 + 650\r\n[ERROR] 52 CoreFoundation 0x2c759a53 + 1418\r\n[ERROR] 53 CoreFoundation 0x2c6a73c1 CFRunLoopRunSpecific + 476\r\n[ERROR] 54 CoreFoundation 0x2c6a71d3 CFRunLoopRunInMode + 106\r\n[ERROR] 55 GraphicsServices 0x33a3c0a9 GSEventRunModal + 136\r\n[ERROR] 56 UIKit 0x2fcb6fa1 UIApplicationMain + 1440\r\n[ERROR] 57 listresize 0x000aed07 listresize + 27911\r\n[ERROR] 58 libdyld.dylib 0x3a79daaf + 2\r\n[ERROR] *** Terminating app due to uncaught exception 'NSRangeException', reason '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'\r\n[ERROR] *** First throw call stack:\r\n[ERROR] (0x2c79549f 0x3a21dc8b 0x2c6a99e1 0x1f0fa9 0x1f73dd 0x2ff1d787 0x2ff1d84b 0x2ff12fa1 0x2fd1d927 0x2fd1d803 0x2fd1ca59 0x2fc6c491 0x2fc6c15b 0x302b35f7 0x2c6bc48f 0x2c6bc38b 0x2fc5cc7b 0x2fc521bb 0x105bc9 0x2fc6c491 0x2fc6c15b 0x2c6bc48f 0x2c6bc38b 0x2fc5cc7b 0x2fc521bb 0x105bc9 0x2fc6c491 0x2fc6c15b 0x2c6bc48f 0x2c6bc38b 0x2fc5cc7b 0x2fc521bb 0x2fc6c491 0x2fc6c15b 0x2c6bc48f 0x2c6bc38b 0x2fc5cc7b 0x2fc521bb 0x2fe87087 0x2fc5524f 0x2f67da0d 0x2f6793e5 0x2fc67987 0x2fc52267 0x2fe88209 0x302f5317 0x2fc88d63 0x2fc9e8fd 0x302f5211 0x2d49af99 0x2c75bc87 0x2c75b803 0x2c759a53 0x2c6a73c1 0x2c6a71d3 0x33a3c0a9 0x2fcb6fa1 0xaed07 0x3a79daaf)\r\n{code}", "attachment": [ { "id": "53308", "filename": "listresize 19-12-14 10-29.crash", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-12-19T09:39:16.000+0000", "size": 48715, "mimeType": "application/octet-stream" } ], "flagged": false, "summary": "iOS: Resizing ListView with all items filtered out crashes with NSRangeException", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "3.5.0.Beta (patched for TIMOB-18260)\r\n3.5.0.Beta\r\n3.4.1.GA", "comment": { "comments": [], "maxResults": 1, "total": 1, "startAt": 0 } } }