{ "id": "90997", "key": "TIMOB-8909", "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": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13401", "description": "Sprint 2012-09 Core", "name": "Sprint 2012-09 Core", "archived": true, "released": true, "releaseDate": "2012-05-06" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-08-09T03:29:44.000+0000", "created": "2012-04-27T17:50:21.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "core", "module_views", "qe-testadded" ], "versions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" } ], "issuelinks": [ { "id": "16895", "type": { "id": "10020", "name": "Depends", "inward": "is dependent of", "outward": "depends on" }, "outwardIssue": { "id": "89535", "key": "TIMOB-8620", "fields": { "summary": "iOS: Ti.UI.View is a live reference, not copy", "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": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-08-13T11:26:03.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": "Currently, Android (and presumably mobileweb) return the empty array {{\\[\\]}} for {{Ti.UI.View.children}} when the view has no children. On iOS, we return {{undefined}}. Complicating matters is the fact that internally, we rely on this value for views with no children; this ticket could involve a substantial amount of work to ensure that no subsystems which rely on checking children content are affected.\r\n\r\nh4. Testing\r\n----\r\n\r\nRun the following test; it should not contain errors, but will only work after [pull request 2098|https://github.com/appcelerator/titanium_mobile/pull/2098] is processed.\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\n \r\nfunction construct() {\r\n for (var i=0; i < 30; i++) {\r\n for (var j=0; j < 30; j++) {\r\n var bgcolor;\r\n switch (i % 3) {\r\n case 0:\r\n bgcolor = 'red';\r\n break;\r\n case 1:\r\n bgcolor = 'blue';\r\n break;\r\n case 2:\r\n bgcolor = 'green';\r\n break;\r\n }\r\n var view = Ti.UI.createView({\r\n top:(j*10),\r\n left:(i*10),\r\n width:10,\r\n height:10,\r\n backgroundColor:bgcolor\r\n });\r\n win.add(view);\r\n Ti.API.info('A '+win.children.length);\r\n }\r\n }\r\n setTimeout(destruct, 3000);\r\n}\r\n \r\nfunction destruct() {\r\n\tif (win.children.length > 0) \r\n {\r\n Ti.API.info('B '+win.children.length);\r\n //Remove is a non blocking call so do it in a timed loop\r\n win.remove(win.children[0]);\r\n setTimeout(destruct,10);\r\n }\r\n else\r\n {\r\n\t\tsetTimeout(construct, 3000);\r\n }\r\n}\r\n\r\nwin.addEventListener('open',function(e){\r\n\tconstruct();\r\n});\r\n\r\nwin.open();\r\n\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Ti.UI.View.children is not the empty array when no children are present", "creator": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "193048", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Only depends on for testing.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-27T17:52:00.000+0000", "updated": "2012-04-27T17:52:00.000+0000" }, { "id": "193571", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Fixed by PR 2112", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-05-03T09:54:53.000+0000", "updated": "2012-05-03T09:54:53.000+0000" }, { "id": "198565", "author": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing issue\r\n\r\nTested with Ti Studio build 2.1.0.201206131907\r\nTi Mobile SDK 2.1.0.v20120613210250 hash rc8ddb29e\r\nOSX Lion 10.7.3\r\niPhone 4S OS 5.1\r\n\r\nThe array is returned empty when there are not children.\r\n\r\n*QE port note* Move the info statement from the if statement in the destruct function to the else block", "updateAuthor": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-14T15:10:07.000+0000", "updated": "2012-06-14T15:10:07.000+0000" }, { "id": "213508", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Re-opening to edit label", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-09T03:29:07.000+0000", "updated": "2012-08-09T03:29:07.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }