{ "id": "60954", "key": "TIMOB-322", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-05-04T11:42:37.000+0000", "created": "2011-04-15T02:27:17.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "api", "module_app_properties", "qe-testadded" ], "versions": [ { "id": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" } ], "issuelinks": [], "assignee": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "updated": "2012-06-05T15:37:49.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}

This is a feature request for:

\n
\nTitanium.App.Properties.setObject(obj)\nTitanium.App.Properties.getObject(obj)\n
\n

At present, if we want to store a non-array object (such as a\nhash map) we have to create an array containing a single element\nwhich holds the object, and then use setList and getList.

\n

This is a bit messy and it would be much easier if we could\nsimply store the object directly.

\n

Thanks

\n

Edit: Someone has already tried to write their\nown custom methods \nhere.

{html}", "attachment": [], "flagged": false, "summary": "Support setObject/getObject in Properties API", "creator": { "name": "jamesk", "key": "jamesk", "displayName": "James K", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jamesk", "key": "jamesk", "displayName": "James K", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "123106", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Invalidated by the flow of time...

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:27:18.000+0000", "updated": "2011-04-15T02:27:18.000+0000" }, { "id": "133893", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "Could I rekindle the discussion about this? \"Invalidated by the flow of time...\" is a bit vague for my taste; is this something we could support? The use case is still very valid, and it would simplify a lot of code.", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-05-18T12:50:25.000+0000", "updated": "2011-05-18T12:50:25.000+0000" }, { "id": "133894", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "What does \"Invalidated by the flow of time...\" mean? I believe this could be very useful to our customers.", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-05-18T12:51:34.000+0000", "updated": "2011-05-18T12:51:34.000+0000" }, { "id": "193028", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "Sent in a PR for this: https://github.com/appcelerator/titanium_mobile/pull/2093\r\n\r\nUsed this code to test, worked on iPhone Simulator 5.1, Android device EPIC 4G 2.3.7, and Chrome with Mobile Web.\r\n{code:title=app.js}\r\ntry {\r\n // Test getting objects.\r\n var getObj = Ti.App.Properties.getObject('MyGetObject', { key: 'get works!' });\r\n assert('get works!', getObj && getObj.key);\r\n\r\n // Test setting objects.\r\n Ti.App.Properties.setObject('MySetObject', { key: 'set works!' });\r\n var setObj = Ti.App.Properties.getObject('MySetObject');\r\n assert('set works!', setObj && setObj.key);\r\n}\r\ncatch (err) {\r\n alert('FAIL! ' + err);\r\n}\r\n\r\nfunction assert(expected, actual) {\r\n if (expected == actual) {\r\n alert('PASS! expected and actual: \"' + actual + '\"');\r\n } else {\r\n alert('FAIL: expected \"' + expected + '\", actual: \"' + actual + '\"');\r\n }\r\n}\r\n{code}", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2012-04-27T15:44:24.000+0000", "updated": "2012-04-27T15:44:24.000+0000" }, { "id": "193343", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Dawson,\r\n\r\nCould you port this test case into drillbit/tests/properties.js? This seems like something we can\r\nautomate in our test suite. If you could add this to your PR that would be great.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-01T15:22:47.000+0000", "updated": "2012-05-01T15:22:47.000+0000" }, { "id": "193753", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Fixed by PR 2093", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-05-04T11:42:37.000+0000", "updated": "2012-05-04T11:42:37.000+0000" }, { "id": "197406", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing feature. Was able to verify App.Properties.getObject and App.Properties.setObject behave as expected on:\r\n\r\nSDK build: 2.1.0.v20120604151821\r\nTitanium Studio, build: 2.1.0.201206041625\r\nRuntime: v8\r\nxcode: 4.3.2\r\nDevice: Droid 1 (2.2.3), iphone 4s verizon (5.0.1)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-06-05T15:27:29.000+0000", "updated": "2012-06-05T15:27:29.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }