{ "id": "93100", "key": "TIMOB-9500", "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": "13502", "description": "Sprint 2012-14 Core", "name": "Sprint 2012-14 Core", "archived": true, "released": true, "releaseDate": "2012-07-15" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-09-11T04:50:44.000+0000", "created": "2012-06-12T10:57:54.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "core", "module_tableviewrow", "qe-review", "qe-testadded", "support" ], "versions": [ { "id": "13273", "description": "Release 2.0.2", "name": "Release 2.0.2", "archived": false, "released": true, "releaseDate": "2012-05-31" }, { "id": "13272", "description": "Release 2.0.1", "name": "Release 2.0.1", "archived": true, "released": true, "releaseDate": "2012-04-16" } ], "issuelinks": [ { "id": "18373", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "81112", "key": "TIMOB-5429", "fields": { "summary": "iOS: TableViewRows are not being reused even though className is set", "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": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-09-11T04:50:45.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": "h2. Problem\r\n\r\nWhen adding table rows dynamically to a table view and there is a large data set, eventually the application will run out of memory because table rows and their child UI components are never released as more rows are scrolled through and added.\r\n\r\nh2. Feature requested\r\n\r\nIn native iOS the table view rows are recycled so even for large or infinite data sets, there is always a limited number of rows that are in memory at any given time. In Titanium, this is not the case. It is not possible to have an infinite amount of table view rows without the application crashing or degrade in performance.", "attachment": [], "flagged": false, "summary": "iOS: Table view rows that are not visible on screen should be recycled", "creator": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS 5\r\nTitanium SDK 2.0.2GA", "comment": { "comments": [ { "id": "198266", "author": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Here is the sample app:\r\n\r\n{code}\r\n\r\nvar buildRow = function() {\r\n\tvar rowView = Titanium.UI.createTableViewRow({\r\n\t\tclassName : 'lolcat',\r\n\t\tlayout : \"vertical\",\r\n\t\theight : 350,\r\n\t\tbackgroundColor : 'pink'\r\n\t});\r\n\r\n\tvar imgAvatar = Titanium.UI.createImageView({\r\n\t\timage : 'http://placekitten.com/g/50/50',\r\n\t\theight : 50,\r\n\t\twidth : 50,\r\n\t\ttop : 5,\r\n\t\tleft : 5\r\n\t});\r\n\r\n\trowView.add(imgAvatar);\r\n\r\n\tvar avaLabel = Ti.UI.createLabel({\r\n\t\ttext : \"Super Cat\",\r\n\t\tfont : {\r\n\t\t\tfontSize : 12,\r\n\t\t\tfontWeight : 'bold'\r\n\t\t},\r\n\t\ttop : 5,\r\n\t\tleft : 65\r\n\t});\r\n\r\n\trowView.add(avaLabel);\r\n\r\n\tvar imgThingy = Titanium.UI.createImageView({\r\n\t\timage : 'http://placekitten.com/g/300/200',\r\n\t\theight : 200,\r\n\t\twidth : 300\r\n\t});\r\n\r\n\trowView.add(imgThingy);\r\n\r\n\tvar postTitle = Ti.UI.createLabel({\r\n\t\ttext : \"Cat saves the day\",\r\n\t\tfont : {\r\n\t\t\tfontSize : 18,\r\n\t\t\tfontWeight : 'bold'\r\n\t\t}\r\n\t});\r\n\r\n\trowView.add(postTitle);\r\n\r\n\tvar postText = Ti.UI.createLabel({\r\n\t\ttext : \"At 12, a helicopter crashed and all passengers were saved by this cat\",\r\n\t\tfont : {\r\n\t\t\tfontSize : 10,\r\n\t\t}\r\n\t});\r\n\r\n\trowView.add(postText);\r\n\t\r\n\treturn rowView;\r\n}\r\n\r\n\r\nvar buildTable = function() {\r\n\tvar data = [];\r\n\tvar table = Ti.UI.createTableView({\r\n\t\ttop : 0,\r\n\t\tright : 0,\r\n\t\tbottom : 0,\r\n\t\tleft : 0\r\n\t});\r\n\r\n\tfor (var i = 0; i < 600; i++) {\r\n\t\tdata.push(buildRow());\r\n\t}\r\n\r\n\ttable.setData(data);\r\n\t\r\n\treturn table;\r\n}\r\n\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : '#fff'\r\n});\r\n\r\nvar table = buildTable();\r\n\r\nwin.add(table);\r\n\r\nwin.open(); \r\n\r\n{code}", "updateAuthor": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-12T16:14:36.000+0000", "updated": "2012-06-12T16:14:36.000+0000" }, { "id": "200357", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR pending https://github.com/appcelerator/titanium_mobile/pull/2473\r\n\r\nTest instructions:\r\nRun the example with Instrument and filter for 'TableView'. Should be:\r\n - 600 living TiUITableViewRowProxy\r\n - 3 living / 0 transitory for TiUITableViewCell, TiUITableViewCellContentView, TiUITableViewRowContainer.", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-26T11:40:54.000+0000", "updated": "2012-06-26T11:40:54.000+0000" }, { "id": "208423", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Pull merged.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-18T19:40:50.000+0000", "updated": "2012-07-18T19:40:50.000+0000" }, { "id": "214358", "author": { "name": "etcarev", "key": "etcarev", "displayName": "Evgenii Tcarev", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed with:\r\nTitanium Studio, build: 2.1.1.201207271312\r\nSDK version: 2.2.0.v20120813184911\r\n\r\nDevices:\r\niPad3 4G (5.1.1)", "updateAuthor": { "name": "etcarev", "key": "etcarev", "displayName": "Evgenii Tcarev", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-14T10:55:57.000+0000", "updated": "2012-08-14T10:55:57.000+0000" }, { "id": "218350", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening to update labels", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-11T04:47:13.000+0000", "updated": "2012-09-11T04:47:13.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }