{ "id": "109392", "key": "TIMOB-12625", "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": "16096", "description": "2014 Sprint 09", "name": "2014 Sprint 09", "archived": true, "released": true, "releaseDate": "2014-05-08" }, { "id": "16097", "description": "2014 Sprint 09 SDK", "name": "2014 Sprint 09 SDK", "archived": true, "released": true, "releaseDate": "2014-05-08" }, { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-05-01T17:47:42.000+0000", "created": "2013-02-07T22:29:44.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_tableview", "parity", "qe-closed-3.3.0", "qe-testadded" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [ { "id": "25622", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "109230", "key": "AC-1962", "fields": { "summary": "TableView updateSection documentation incorrect", "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" } }, "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": "2016-02-25T21:57: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": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "The TableView updateSection method on iOS has the arguments in the wrong order. Unlike the other platforms (and updateRow), it expects the first argument to be a section object and the second argument to be an index.\r\n\r\nThe following code runs on Android and Mobile Web, but fails on iOS.\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : \"#eee\"\r\n});\r\nwin.open();\r\n\r\nvar section = Ti.UI.createTableViewSection({\r\n\theaderView : (function() {\r\n\t\tvar view = Ti.UI.createView();\r\n\t\tvar label = Ti.UI.createLabel({\r\n\t\t\ttext : \"Some Section\"\r\n\t\t});\r\n\t\tview.add(label);\r\n\r\n\t\treturn view;\r\n\t})()\r\n});\r\n\r\nvar row = Ti.UI.createTableViewRow({\r\n\ttitle : \"Row\"\r\n});\r\n\r\nsection.add(row);\r\nvar section2 = Ti.UI.createTableViewSection({\r\n\theaderView : (function() {\r\n\t\tvar view = Ti.UI.createView();\r\n\t\tvar label = Ti.UI.createLabel({\r\n\t\t\ttext : \"Different Section\"\r\n\t\t});\r\n\t\tview.add(label);\r\n\r\n\t\treturn view;\r\n\t})()\r\n});\r\n\r\nvar row2 = Ti.UI.createTableViewRow({\r\n\ttitle : \"Row 2\"\r\n});\r\n\r\nsection2.add(row2);\r\nvar table = Ti.UI.createTableView({\r\n\tdata: [ section ]\r\n});\r\n\r\ntable.updateSection(0, section2);\r\n\r\ntable.addEventListener(\"click\", function(event) {\r\n\talert(\"TableView Clicked\");\r\n\tTi.API.debug(event.row);\r\n});\r\n\r\nwin.add(table);\r\n{code}\r\n", "attachment": [ { "id": "36614", "filename": "iOS Simulator Screen shot Mar 25, 2013 3.00.39 PM.png", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-25T09:31:45.000+0000", "size": 49842, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: TableView.updateSection argument order is wrong", "creator": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "237682", "author": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Methinks:\r\n\r\n{code}\r\n--- a/iphone/Classes/TiUITableViewProxy.m\r\n+++ b/iphone/Classes/TiUITableViewProxy.m\r\n@@ -1084,9 +1084,9 @@ DEFINE_DEF_PROP(scrollsToTop,[NSNumber numberWithBool:YES]);\r\n }\r\n \r\n int sectionIndex;\r\n- ENSURE_INT_AT_INDEX(sectionIndex, args, 1);\r\n+ ENSURE_INT_AT_INDEX(sectionIndex, args, 0);\r\n \r\n- id sectionObject = [args objectAtIndex:0];\r\n+ id sectionObject = [args objectAtIndex:1];\r\n TiUITableViewSectionProxy * section = [self tableSectionFromArg:sectionObject];\r\n \r\n if (section == nil) {\r\n{code}\r\n", "updateAuthor": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-07T22:34:57.000+0000", "updated": "2013-02-07T22:35:11.000+0000" }, { "id": "302585", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/5646", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-04-25T20:45:20.000+0000", "updated": "2014-04-25T20:45:20.000+0000" }, { "id": "303194", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR Merged", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-05-01T17:47:42.000+0000", "updated": "2014-05-01T17:47:42.000+0000" }, { "id": "303459", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Clicking the tableview, section gets updated\r\nVerified the fix on:\r\nDevice : iPhone 5c , iOS version : 7.1\r\nSDK: 3.3.0.v20140502133323\r\nCLI version : 3.3.0-dev\r\nOS : MAC OSX 10.9.2\r\nAlloy: 1.4.0-dev\r\nACS: 1.0.14\r\nnpm:1.3.2\r\nAppcelerator Studio, build: 3.3.0.201405011408\r\ntitanium-code-processor: 1.1.1\r\nXCode : 5.1.1\r\n\r\nTestcase used:\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor : \"#eee\"\r\n});\r\nwin.open();\r\n \r\nvar section = Ti.UI.createTableViewSection({\r\n headerView : (function() {\r\n var view = Ti.UI.createView();\r\n var label = Ti.UI.createLabel({\r\n text : \"Some Section\"\r\n });\r\n view.add(label);\r\n \r\n return view;\r\n })()\r\n});\r\n \r\nvar row = Ti.UI.createTableViewRow({\r\n title : \"Row\"\r\n});\r\n \r\nsection.add(row);\r\nvar section2 = Ti.UI.createTableViewSection({\r\n headerView : (function() {\r\n var view = Ti.UI.createView();\r\n var label = Ti.UI.createLabel({\r\n text : \"Different Section\"\r\n });\r\n view.add(label);\r\n \r\n return view;\r\n })()\r\n});\r\n \r\nvar row2 = Ti.UI.createTableViewRow({\r\n title : \"Row 2\"\r\n});\r\n \r\nsection2.add(row2);\r\nvar table = Ti.UI.createTableView({\r\n data: [ section ]\r\n});\r\n \r\n\r\n \r\ntable.addEventListener(\"click\", function(event) {\r\n alert(\"TableView Clicked\");\r\n Ti.API.debug(event.row);\r\n table.updateSection(0, section2);\r\n});\r\n \r\nwin.add(table);\r\n{code}", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-05-05T09:55:56.000+0000", "updated": "2014-05-05T09:55:56.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }