{ "id": "61397", "key": "TIMOB-765", "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": "11223", "name": "Release 1.3.0", "archived": true, "released": true, "releaseDate": "2010-05-05" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:54:10.000+0000", "created": "2011-04-15T02:35:53.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:54:10.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": "{html}
after initial load, click button to load next set of data. table\nview crashes
\nfrom premium ticket:
\nhttp://helpdesk.appcelerator.net/tickets/1847
\nhere's the code:
\n//Variable storing when the platform is android var android =\n(Ti.Platform.name == \"android\");
\n//BG Color to White\n//Titanium.UI.setBackgroundColor(android?#181818;
\n//Create 5 individual windows var win1 =\nTi.UI.createWindow();
\n//Create the table view and set the data var tableview =\nTitanium.UI.createTableView({top:50});
\nwin1.add(tableview);
//Set data counter to keep track of getData calls var dataCount\n= 0;
\nvar epicFail = false;
\n//Make client var xhr = Ti.Network.createHTTPClient();
//This function loads the game data function getData(window,\nplatform) {
\n\n//Data failure\nxhr.onerror = function (e) { \n if (!epicFail) { \n alert(\"A Net Load failed! Best to check your connection and reload app later!\"); \n } \n epicFail = true; \n};\n//Upon data load\nxhr.onload = function( ) {\n //Create clean data array\n var data = []; \n //Get the JSON out\n var resp = eval(\"(\" + this.responseText + \")\");\n\n //Set img width, if DS, make it bigger\n var imgWidth = 50;\n if (platform == \"Nintendo%20DS\") {\n imgWidth = 75;\n }\n\n Ti.API.info('PRODUCT COUNT = ' + resp.products.length);\n\n //Loop through and create rows for every product pulled\n for (var i=0;i < resp.products.length;i++) {\n var row = Ti.UI.createTableViewRow({\n height:70\n //backgroundColor:\"white\"\n });\n //Get the game name\n var gamename = resp.products[i].name;\n //Replace unwanted data in name\n gamename = gamename.replace(\"- \" + resp.products[i].platform,\"\");\n gamename = gamename.replace(/%/g,\"&\");\n gamename = gamename.replace(/ü/g,\"ü\");\n gamename = gamename.replace(/é/g,\"é\");\n gamename = gamename.replace(/!/g,\"©\");\n\n //Create an image for the cell using the thumbnail image\n\n var img = Ti.UI.createImageView({\n url:resp.products[i].thumbnailImage,\n left:5,width:50,height:67\n });\n //Create a label for the cell using the game name\n var lbl = Ti.UI.createLabel({\n text:gamename,\n top:5,left:imgWidth + 10,\n textAlign:\"left\",\n font:{fontWeight:\"bold\",fontSize:12} \n });\n //Add the label and image to the row \n row.add(lbl);\n row.add(img);\n Ti.API.info('IMAGE ' + img + ' url ' + img.url + ' i ' + i);\n\n data[i] = row;\n }\n tableview.setData(data);\n\n};//End onload\nxhr.open(\"GET\",\"http://api.remix.bestbuy.com/v1/products(type=game&platform=\" + platform +\")?sort=salesRankShortTerm&format=json&apiKey=sexdfjckv6be3gq49rpt4jby\");\nxhr.send();
\n
\n}
\n//Get the desired data getData(win1,\"Xbox%20360\");
\nbtn1 = Ti.UI.createButton({
\ntitle:\"Next platform\",\nwidth:120,height:40,top:0
\n
\n});
\nbtn1.addEventListener(\"click\",function(e) {
\n//getData(win1, \"Nintendo%20DS\");\ngetData(win1, \"Xbox\");
\n
\n});
\nwin1.add(btn1);
\nwin1.open();
I've been having the same issue since yesterday's 'trying to\nspeed up tableviews' commit.
(from [9fda09a034a68971fc1d249500663703afc3bba6])\nCloses #765: New proxy needed to be retained (may be\nfreed twice). Checking with instruments confirms no memory leak.\n\nhttp://github.com/appcelerator/titanium_mobile/commit/9fda09a034a68...