{ "id": "86715", "key": "AC-3027", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-06-13T18:10:45.000+0000", "created": "2012-02-21T07:53:01.000+0000", "labels": [ "IOS,", "TableView", "deleteRow", "updaterow" ], "versions": [], "issuelinks": [], "assignee": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:48:03.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "h2. Problem\r\nWhen using Ti.UI.TableView.updateRow, you can no longer call Ti.UI.TableView.deleteRow without causing an error. \r\nh2. IOS Error\r\n{panel:borderStyle=dashed| borderColor=#ccc| titleBGColor=#F7D6C1| bgColor=#000000}\r\n{color:red}[ERROR] Value was not the value expected. ([rows containsObject:row]) was not (YES) in -[TiUITableView deleteRow:] (TiUITableView.m:524{color}\r\n{color:white}2012-02-21 09:16:02.692 TestListBox[2189:17903] *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-1912.3/UITableView.m:1046{color}\r\n{color:red}[ERROR] The application has crashed with an unhandled exception. Stack trace:{color}\r\n{color:white}0 CoreFoundation 0x02e8c052 __exceptionPreprocess + 178\r\n1 libobjc.A.dylib 0x02cacd0a objc_exception_throw + 44\r\n2 CoreFoundation 0x02e34a78 +[NSException raise:format:arguments:] + 136\r\n3 Foundation 0x009752db -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116\r\n4 UIKit 0x00cbf518 -[UITableView(_UITableViewPrivate) _endCellAnimationsWithContext:] + 9000\r\n5 UIKit 0x00cca82a -[UITableView _updateRowsAtIndexPaths:updateAction:withRowAnimation:] + 295\r\n6 UIKit 0x00cca8a5 -[UITableView deleteRowsAtIndexPaths:withRowAnimation:] + 55\r\n7 TestListBox 0x000a1c17 -[TiUITableView dispatchAction:] + 5975\r\n8 TestListBox 0x0009a11c -[TiUITableViewProxy deleteRow:] + 732\r\n9 CoreFoundation 0x02e8de72 -[NSObject performSelector:withObject:] + 66\r\n10 Foundation 0x009049ef __NSThreadPerformPerform + 254\r\n11 CoreFoundation 0x02e6097f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15\r\n12 CoreFoundation 0x02dc3b73 __CFRunLoopDoSources0 + 243\r\n13 CoreFoundation 0x02dc3454 __CFRunLoopRun + 1012\r\n14 CoreFoundation 0x02dc2db4 CFRunLoopRunSpecific + 212\r\n15 CoreFoundation 0x02dc2ccb CFRunLoopRunInMode + 123\r\n16 GraphicsServices 0x02aeb879 GSEventRunModal + 207\r\n17 GraphicsServices 0x02aeb93e GSEventRun + 114\r\n18 UIKit 0x00c3ba9b UIApplicationMain + 1175\r\n19 TestListBox 0x000041ba main + 442\r\n20 TestListBox 0x00002b55 start + 53\r\n21 ??? 0x00000001 0x0 + 1\r\n2012-02-21 09:16:02.792 TestListBox[2189:17903] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (1) must be equal to the number of rows contained in that section before the update (1), plus or minus the number of rows inserted or deleted from that section (0 inserted, 1 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).'\r\n*** First throw call stack:\r\n(0x2e8c052 0x2cacd0a 0x2e34a78 0x9752db 0xcbf518 0xcca82a 0xcca8a5 0xa1c17 0x9a11c 0x2e8de72 0x9049ef 0x2e6097f 0x2dc3b73 0x2dc3454 0x2dc2db4 0x2dc2ccb 0x2aeb879 0x2aeb93e 0xc3ba9b 0x41ba 0x2b55 0x1)\r\nterminate called throwing an exception\r\n[INFO] Application has exited from Simulator{color}\r\n{panel} \r\nh2. Steps to reproduce\r\n# Make a project with the below app.js. \r\n# Click the 'update rows' button (this will only update row 0)\r\n# Click the 'delete rows' button\r\n#* Notice that the simulator exits with the previous error message. \r\n#* - SDK 1.8.2 will not exit but give a similar message. It will only delete row 1 and leave row 0 (the updated one)\r\n\r\n{code:title=app.js|borderStyle=solid}\r\nvar win1 = Ti.UI.createWindow({});\r\n\r\n\r\nvar data = [{title:'Row 1'}, {title:'Row 2'}];\r\nvar table = Ti.UI.createTableView({data:data});\r\nwin1.add(table);\r\n\r\n\r\nvar btn1 = Ti.UI.createButton({\r\n title:'delete rows',\r\n width:120,\r\n height:50,\r\n left:10,\r\n bottom:0\r\n});\r\nbtn1.addEventListener('click',DoBtn1Click);\r\nwin1.add(btn1);\r\n\r\nvar btn2 = Ti.UI.createButton({\r\n title:'update rows',\r\n width:120,\r\n height:50,\r\n right:10,\r\n bottom:0\r\n});\r\nbtn2.addEventListener('click',DoBtn2Click);\r\nwin1.add(btn2);\r\n\r\n\r\nfunction DoBtn1Click()\r\n{\r\n for (var row=(table.data[0].rowCount-1); (row >= 0); row--)\r\n table.deleteRow(row);\r\n}\r\n\r\nfunction DoBtn2Click()\r\n{\r\n table.updateRow(0, table.data[0].rows[0]);\r\n}\r\n\r\nwin1.open();\r\n{code}\r\n\r\n", "attachment": [], "flagged": false, "summary": "IOS: Calling Ti.UI.TableView.updateRow causes deleteRow to return [ERROR]", "creator": { "name": "jlbarnhart", "key": "jlbarnhart", "displayName": "Jon Barnhart", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jlbarnhart", "key": "jlbarnhart", "displayName": "Jon Barnhart", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "* Titanium SDK 1.8.1\r\n* iPhone 5.0 Simulator\r\n* MAC OS Lion\r\n\r\n", "comment": { "comments": [ { "id": "184089", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello,\r\ntested in 1.9 CI build, it's working fine. You can get the buidl from this page:\r\n\r\nhttp://builds.appcelerator.com.s3.amazonaws.com/index.html\r\n\r\nchoose the master branch, and copy the url for your platform, and then from the help menu in Ti Studio, just install from SDK.\r\n\r\nBest,\r\n\r\nMauro", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2012-02-23T12:30:15.000+0000", "updated": "2012-02-23T12:30:15.000+0000" }, { "id": "184097", "author": { "name": "jlbarnhart", "key": "jlbarnhart", "displayName": "Jon Barnhart", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Mauro,\r\n\r\nWhen I choose the \"master\" branch, I get the 2.0 SDK downloads. I don't see a choice for 1.9. \r\n\r\nI did however download the 2.0 SDK and tried it with my test application that I provided in the code and it still gives me the same error. I know that the fix may not be merged into the 2.0 code yet, but is there a way you could merge the fix into 1.8.2? \r\n\r\nAlso, I have simplified the steps to re-create this issue.\r\n\r\nJon", "updateAuthor": { "name": "jlbarnhart", "key": "jlbarnhart", "displayName": "Jon Barnhart", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-23T12:57:01.000+0000", "updated": "2012-02-23T12:57:01.000+0000" }, { "id": "188581", "author": { "name": "jlbarnhart", "key": "jlbarnhart", "displayName": "Jon Barnhart", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fix on SDK 2.0.0.v20120325213306. Thanks!", "updateAuthor": { "name": "jlbarnhart", "key": "jlbarnhart", "displayName": "Jon Barnhart", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-26T09:22:31.000+0000", "updated": "2012-03-26T09:22:31.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }