{ "id": "63792", "key": "TIMOB-3160", "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": "11333", "description": "Mobile 1.8.0 M01", "name": "Sprint 2011-22", "archived": true, "released": true, "releaseDate": "2011-06-06" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-11-05T15:46:33.000+0000", "created": "2011-04-15T03:38:21.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "11231", "name": "Release 1.5.1", "archived": true, "released": true, "releaseDate": "2011-01-24" } ], "issuelinks": [], "assignee": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-11-05T15:46:33.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}
Application crashes when you try to use 'this' in\r\nremoveEventListener to remove an addEventListener who's function\r\nyou are in.
\r\nThis code sample if from the code example at \r\nhttp://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI....
\r\n\r\n\r\nvar view = Titanium.UI.createView({\r\n backgroundColor:'red'\r\n});\r\nvar animation = Titanium.UI.createAnimation();\r\nanimation.backgroundColor = 'black';\r\nanimation.duration = 1000;\r\nanimation.addEventListener('complete',function()\r\n{\r\n animation.removeEventListener('complete',this);\r\n animation.backgroundColor = 'orange';\r\n view.animate(animation);\r\n});\r\nview.animate(animation);
\r\n
\r\ntested with 1.5.1, 1.6.0RC1, iOS SDK 4.2
\r\nYou might use 'arguments.callee' instead of 'this' to solve this\nissue.
\n'arguments.callee' is itself that no name inner function.
\nanimation.addEventListener('complete',function()
\n{ animation.backgroundColor = 'orange'; view.animate(animation);\nanimation.removeEventListener('complete', arguments.callee);\n});
sorry, poor my english.