{ "id": "92282", "key": "TIMOB-9223", "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": "13407", "description": "Sprint 2012-11 API", "name": "Sprint 2012-11 API", "archived": true, "released": true, "releaseDate": "2012-06-03" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-06-02T22:27:38.000+0000", "created": "2012-05-24T08:00:56.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "module_clipboard", "parity", "qe-testadded" ], "versions": [ { "id": "13272", "description": "Release 2.0.1", "name": "Release 2.0.1", "archived": true, "released": true, "releaseDate": "2012-04-16" } ], "issuelinks": [], "assignee": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-11-06T19:04:28.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": "h2. Problem\r\n\r\nThe hasText method of [Titanium.UI.Clipboard|http://docs.appcelerator.com/titanium/2.0/index.html#!/api/Titanium.UI.Clipboard] returns a Number {{0}} or {{1}} rather than {{true}} or {{false}} respectively.\r\n\r\nSee the test case below, and the source at [TiUIClipboardProxy.m|https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiUIClipboardProxy.m].\r\n\r\nNote that Android returns Boolean as expected.\r\n\r\nh2. Test case\r\n\r\n{code:lang=javascript|title=app.js}\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nTi.API.log('Deleting all text in Clipboard');\r\nTi.UI.Clipboard.clearText();\r\nTi.API.log('Clipboard.getText() empty: ' + Ti.UI.Clipboard.getText()); // returns undefined when empty\r\nTi.API.log('Set text Clipboard to hello');\r\nTi.UI.Clipboard.setText('hello');\r\nTi.API.log('Clipboard.hasText(), should be true: ' + Ti.UI.Clipboard.hasText()); // hasText() returns 0 or 1 instead of boolean\r\nTi.API.log('Clipboard.getText(), should be hello: ' + Ti.UI.Clipboard.getText());\r\n{code}\r\n\r\n", "attachment": [], "flagged": false, "summary": "iOS: UI.Clipboard hasText returns Number rather than Boolean", "creator": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "environment": "* Titanium 2.0.1 GA2\r\n* iOS 5.0\r\n* Simulator", "comment": { "comments": [ { "id": "196211", "author": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Addressed in PR:\r\nhttps://github.com/appcelerator/titanium_mobile/pull/2283", "updateAuthor": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-27T14:22:22.000+0000", "updated": "2012-05-27T14:22:22.000+0000" }, { "id": "196403", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "APIDocs fixed in https://github.com/appcelerator/titanium_mobile/pull/2269", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-05-29T18:02:48.000+0000", "updated": "2012-05-29T18:02:48.000+0000" }, { "id": "197205", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The clipboard methods hasText returns boolean value True/False.\r\nVerified on:\r\nTitanium Studio: 2.1.0.201206010843\r\nTitanium SDK: 2.1.0.v20120604151821\r\niOS Simulator 5.0", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-04T23:57:09.000+0000", "updated": "2012-06-04T23:57:09.000+0000" }, { "id": "278473", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4731\n", "updateAuthor": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-06T19:04:28.000+0000", "updated": "2013-11-06T19:04:28.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }