{ "id": "83474", "key": "TIMOB-6507", "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": "12571", "description": "CI for 1_7_X", "name": "Release 1.7.6", "archived": true, "released": false }, { "id": "12093", "description": "", "name": "Sprint 2012-01", "archived": true, "released": true, "releaseDate": "2012-01-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-01-11T09:49:58.000+0000", "created": "2011-12-07T15:11:54.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "12570", "name": "Release 1.7.5", "archived": true, "released": true, "releaseDate": "2011-11-02" }, { "id": "12571", "description": "CI for 1_7_X", "name": "Release 1.7.6", "archived": true, "released": false } ], "issuelinks": [], "assignee": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-01-18T17:26:19.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": "h3.Problem\r\nThe application crashes after updating the imageView rapidly with remote images.\r\n\r\nIt does work with CI Build 1.8.0 but not with SDK 1.7.5 and 1.7.6.v20111203085900\r\n\r\nh3.Reproducible Steps\r\n1. Run the sample code\r\n2. Press \"start\" button\r\n\r\nh3.Sample Code\r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nvar SERVICE_EVENT_URL = \"http://api.ticketalternative.com/Services/GetEvents.ashx?months=6&venueid=3&Format=json\";\r\nvar SERVICE_ARTIST_URL = \"http://api.ticketalternative.com/Services/GetArtists.ashx?Format=json&venueId=3\";\r\nvar URL_IMAGE_SMALL = \"http://www.ticketAlternative.com/wiu.aspx?w=187&h=97&p=\";\r\n\r\n// create tab group\r\nvar tabGroup = Titanium.UI.createTabGroup();\r\n\r\n\r\n\r\n\r\n//\r\n// create base UI tab and root window\r\n//\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\nvar tab1 = Titanium.UI.createTab({ \r\n icon:'KS_nav_views.png',\r\n title:'Tab 1',\r\n window:win1\r\n});\r\n\r\nvar label1 = Titanium.UI.createLabel({\r\n color:'#999',\r\n text:'I am Window 1',\r\n font:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n textAlign:'center',\r\n width:'auto'\r\n});\r\n\r\n//win1.add(label1);\r\n\r\n//\r\n// create controls tab and root window\r\n//\r\nvar win2 = Titanium.UI.createWindow({ \r\n title:'Tab 2',\r\n backgroundColor:'#fff'\r\n});\r\nvar tab2 = Titanium.UI.createTab({ \r\n icon:'KS_nav_ui.png',\r\n title:'Tab 2',\r\n window:win2\r\n});\r\n\r\nvar label2 = Titanium.UI.createLabel({\r\n color:'#999',\r\n text:'I am Window 2',\r\n font:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n textAlign:'center',\r\n width:'auto'\r\n});\r\n\r\nwin2.add(label2);\r\n\r\n\r\n\r\nvar button = Titanium.UI.createButton({\r\n \r\n title:'start',\r\n //backgroundColor : \"#ff0000\",\r\n color: \"#ff0000\",\r\n width : 150,\r\n height : 100,\r\n top:100,\r\n left:100\r\n \r\n \r\n});\r\nvar imageView = Titanium.UI.createImageView( \r\n {\r\n top:0,\r\n left:0,\r\n width:85,\r\n height:44\r\n \r\n });\r\nwin1.add(imageView);\r\nwin1.add(button);\r\n\r\nbutton.addEventListener(\"click\", callHTTPService);\r\n\r\n\r\n//\r\n// add tabs\r\n//\r\ntabGroup.addTab(tab1); \r\ntabGroup.addTab(tab2); \r\n\r\n\r\n// open tab group\r\ntabGroup.open();\r\n\r\n\r\n\r\nvar loadingArtists = false;\r\n\r\nvar currentURL = SERVICE_EVENT_URL;\r\n\r\nvar httpClient = null;\r\n\r\n// we are going to load artists first, then events, then back to artists to try to make the HTTPClient fail.\r\n\r\nfunction callHTTPService()\r\n{\r\n Titanium.API.debug(\"calling service: \" + currentURL);\r\n \r\n httpClient = Titanium.Network.createHTTPClient();\r\n operation = \"GET\";\r\n\r\n httpClient.onload = handleOnLoad;\r\n //httpClient.ondatastream = ondatastream;\r\n httpClient.open(operation, currentURL);\r\n \r\n \r\n \r\n \r\n httpClient.send();\r\n \r\n \r\n}\r\n\r\nfunction handleOnLoad(result )\r\n{\r\n \r\n Titanium.API.info(\"loaded \" + currentURL);\r\n \r\n\r\n updateData( result);\r\n\r\n}\r\n\r\n\r\n\r\nfunction updateData( result)\r\n{\r\n var data = JSON.parse(httpClient.responseText);\r\n \r\n var eventsASjson = data[0].venue.events;\r\n \r\n var imgTable = new Array();\r\n \r\n \r\n for (var i=0 ;i< eventsASjson.length; i++)\r\n {\r\n \r\n var jsonObject = eventsASjson[i];\r\n this.smallImage = URL_IMAGE_SMALL + jsonObject.defaultPhoto;\r\n // this.imageView.image = this.smallImage;\r\n Ti.API.info(this.smallImage);\r\n imgTable.push(this.smallImage);\r\n \r\n Titanium.API.debug(imgTable[i])\r\n }\r\n \r\n for(var i=0; i