{ "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

\n

from premium ticket:

\n

http://helpdesk.appcelerator.net/tickets/1847

\n

here'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);

\n

//Set data counter to keep track of getData calls var dataCount\n= 0;
\nvar epicFail = false;
\n//Make client var xhr = Ti.Network.createHTTPClient();

\n

//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(/&#37;/g,\"&\");\n        gamename = gamename.replace(/&#252;/g,\"ü\");\n        gamename = gamename.replace(/&#233;/g,\"é\");\n        gamename = gamename.replace(/&#33;/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\");

\n

btn1 = Ti.UI.createButton({

\n
\ntitle:\"Next platform\",\nwidth:120,height:40,top:0\n
\n

});

\n

btn1.addEventListener(\"click\",function(e) {

\n
\n//getData(win1, \"Nintendo%20DS\");\ngetData(win1, \"Xbox\");\n
\n

});

\n

win1.add(btn1);

\n

win1.open();

{html}", "attachment": [], "flagged": false, "summary": "Table View crash on second load", "creator": { "name": "nwright", "key": "nwright", "displayName": "Nolan Wright", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "nwright", "key": "nwright", "displayName": "Nolan Wright", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "123971", "author": { "name": "kosso", "key": "kosso", "displayName": "kosso", "active": true, "timeZone": "Europe/London" }, "body": "{html}

I've been having the same issue since yesterday's 'trying to\nspeed up tableviews' commit.

{html}", "updateAuthor": { "name": "kosso", "key": "kosso", "displayName": "kosso", "active": true, "timeZone": "Europe/London" }, "created": "2011-04-15T02:35:54.000+0000", "updated": "2011-04-15T02:35:54.000+0000" }, { "id": "123972", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(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...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:35:54.000+0000", "updated": "2011-04-15T02:35:54.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }