{ "id": "115726", "key": "TIMOB-14166", "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": "16593", "description": "Release 4.0.0", "name": "Release 4.0.0", "archived": false, "released": true, "releaseDate": "2015-05-21" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-03-31T17:35:56.000+0000", "created": "2013-06-10T09:00:31.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "TSP", "deleteSection", "tableview", "textfield" ], "versions": [], "issuelinks": [ { "id": "46971", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "132859", "key": "TIMOB-17404", "fields": { "summary": "iOS: Focusing TextField in HeaderView of empty TableView causes application to crash on iOS7.1", "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": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2015-04-09T21:08:08.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": "If I want to delete section using \"table.deleteSection(index, animate);\" and I want to delete all sections application unfortunately crash. *Application crash only if I before clicked on a textfield ,so textfield has focus.\r\n\r\n*EXAMPLE:*\r\n{code:javascript} \r\nvar win = Ti.UI.createWindow({layout: \"vertical\"});\r\nvar table = Ti.UI.createTableView({ style: Ti.UI.iPhone.TableViewStyle.GROUPED });\r\nvar data = [];\r\n\r\nvar buttonsWrap = Ti.UI.createView({layout: \"horizontal\", width: Ti.UI.FILL, height: Ti.UI.SIZE});\r\nvar removeFromBottom = Ti.UI.createButton({title: \"REMOVE FROM BOTTOM\", width: \"50%\", height: 30});\r\n\tremoveFromTop = Ti.UI.createButton({title: \"REMOVE FROM TOP\", width: \"50%\", height: 30});\r\n\r\nfor(i=0;i<3;i++)\r\n{\r\n\tvar section = Ti.UI.createTableViewSection({width: Ti.UI.FILL, height: Ti.UI.SIZE});\r\n\tvar row = Ti.UI.createTableViewRow({width: Ti.UI.FILL, height: Ti.UI.FILL, backgroundImage: \"transparentBG.png\"});\r\n\tvar tField = Ti.UI.createTextField({width: Ti.UI.FILL, height: Ti.UI.FILL, backgroundColor: \"white\"});\r\n\t\r\n\trow.add(tField);\r\n\tsection.add(row);\r\n\tdata.push(section);\r\n}\r\n\r\n\r\ntable.data = data;\r\n\r\nbuttonsWrap.add(removeFromBottom);\r\nbuttonsWrap.add(removeFromTop);\r\n\r\nwin.add(buttonsWrap);\r\nwin.add(table);\r\nwin.open();\r\n\r\n\r\nremoveFromBottom.addEventListener(\"click\", function(){\r\n\ttable.deleteSection(2, {animationStyle: Ti.UI.iPhone.RowAnimationStyle.FADE});\r\n\ttable.deleteSection(1, {animationStyle: Ti.UI.iPhone.RowAnimationStyle.FADE});\t\t\r\n\ttable.deleteSection(0, {animationStyle: Ti.UI.iPhone.RowAnimationStyle.FADE});\t\t\t\t\t\r\n});\r\n\r\nremoveFromTop.addEventListener(\"click\", function(){\r\n\ttable.deleteSection(0, {animationStyle: Ti.UI.iPhone.RowAnimationStyle.FADE});\t\r\n\ttable.deleteSection(0, {animationStyle: Ti.UI.iPhone.RowAnimationStyle.FADE});\t\r\n\ttable.deleteSection(0, {animationStyle: Ti.UI.iPhone.RowAnimationStyle.FADE});\t\t\t\r\n});\r\n{code}\r\n\r\n\r\n*CONSOLE OUTPUT:*\r\n{quote}\r\n[ERROR] : The application has crashed with an uncaught exception 'NSInternalInconsistencyException'.\r\n[ERROR] : Reason:\r\n[ERROR] : request for rect of invalid section (-1)\r\n[ERROR] : Stack trace:\r\n[ERROR] : 0 CoreFoundation 0x038ed012 __exceptionPreprocess + 178\r\n[ERROR] : 1 libobjc.A.dylib 0x033aee7e objc_exception_throw + 44\r\n[ERROR] : 2 CoreFoundation 0x038ece78 +[NSException raise:format:arguments:] + 136\r\n[ERROR] : 3 Foundation 0x00e63665 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116\r\n[ERROR] : 4 UIKit 0x013933e3 -[UITableViewRowData rectForSection:] + 181\r\n[ERROR] : 5 UIKit 0x01257144 -[UITableView rectForSection:] + 80\r\n[ERROR] : 6 ewd 0x000cd16e -[TiUITableView keyboardDidShowAtHeight:] + 430\r\n[ERROR] : 7 ewd 0x001f6425 -[TiRootViewController handleNewKeyboardStatus] + 869\r\n[ERROR] : 8 Foundation 0x00dcb5b3 __NSFireDelayedPerform + 380\r\n[ERROR] : 9 CoreFoundation 0x038ac376 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22\r\n[ERROR] : 10 CoreFoundation 0x038abe06 __CFRunLoopDoTimer + 534\r\n[ERROR] : 11 CoreFoundation 0x03893a82 __CFRunLoopRun + 1810\r\n[ERROR] : 12 CoreFoundation 0x03892f44 CFRunLoopRunSpecific + 276\r\n[ERROR] : 13 CoreFoundation 0x03892e1b CFRunLoopRunInMode + 123\r\n[ERROR] : 14 GraphicsServices 0x036747e3 GSEventRunModal + 88\r\n[ERROR] : 15 GraphicsServices 0x03674668 GSEventRun + 104\r\n[ERROR] : 16 UIKit 0x011aaffc UIApplicationMain + 1211\r\n[ERROR] : 17 ewd 0x00004358 main + 456\r\n[ERROR] : 18 ewd 0x00002c65 start + 53\r\n[ERROR] : 2013-06-10 09:49:24.010 ewd[42008:1c103] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'request for rect of invalid section (-1)'\r\n[ERROR] : *** First throw call stack:\r\n[ERROR] : (0x38ed012 0x33aee7e 0x38ece78 0xe63665 0x13933e3 0x1257144 0xcd16e 0x1f6425 0xdcb5b3 0x38ac376 0x38abe06 0x3893a82 0x3892f44 0x3892e1b 0x36747e3 0x3674668 0x11aaffc 0x4358 0x2c65)\r\n-- End simulator log ---------------------------------------------------------\r\n[INFO] : Application has exited from iOS Simulator\r\n[INFO] : Project built successfully in 31s 418ms\r\n{quote}\r\n\r\n\r\n\r\n*WORKAROUND* \r\n{quote}\r\nJust call for every textfield function blur();\r\n{quote}", "attachment": [], "flagged": false, "summary": "iOS: Delete section that include focused textfield causes app to crash", "creator": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS 8.1.3\r\nTitanium SDK 3.5.0.GA", "closedSprints": [ { "id": 362, "state": "closed", "name": "2015 Sprint 06 SDK", "startDate": "2015-03-14T13:56:53.868Z", "endDate": "2015-03-28T00:00:00.000Z", "completeDate": "2015-03-30T17:32:33.590Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "256954", "author": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Confirmed with 3.2CI, iOS sim 6.0, with Titanium Studio, build: 3.1.0.201303032333.\n\nThanks for bringing this to our attention. Moving to Ti-Mobile.\n\nRegards,\nCarter", "updateAuthor": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-10T17:53:45.000+0000", "updated": "2013-06-10T17:53:45.000+0000" }, { "id": "347597", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~egomez] confirming that there is a bug in TableView.\r\nThe reason this is happening is that the TextFields have a height of \"Ti.UI.SIZE\" and the system is calculating a float value height of 49.6666 when you type something and then rounding that to 49.0. On editing the text by typing more, it goes back to 49.6666 and then it compares it to the previos 49.0. This tells the TableView to do an update on the rows, the sections, and so on. For some reason, still investigating, this is causing the internal TableView to fail a assert statement on the number or sections.\r\n\r\nTo work around this, for now, hard code the height of the TextField to something appropriate, such as \"44\", or \"50\". Setting the height of the TextField will avoid all the automatic checks and unnecessary updates on the TableView data source.\r\n\r\nSolution: use a number for the height of the TextField instead of Ti.UI.SIZE", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-03-27T22:00:36.000+0000", "updated": "2015-03-27T22:00:36.000+0000" }, { "id": "347951", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "This issue is the same as the one related in TIMOB-17404 and is already fixed in 4_0_X and master branches", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-03-31T17:35:56.000+0000", "updated": "2015-03-31T17:35:56.000+0000" }, { "id": "349094", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix. \r\nDeleting the section that includes a focussed textfield does not crash the app.\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio : 4.0.0.201504081125\r\nTi SDK : 4.0.0.v20150408131013\r\nCLI : 4.0.0-beta5\r\nAlloy : 1.6.0-beta2\r\nMAC Yosemite : 10.10.2\r\nAppc npm : 0.3.39\r\nAppc CLI : 0.2.235", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-04-09T21:07:38.000+0000", "updated": "2015-04-09T21:07:38.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }