{ "id": "171802", "key": "AC-5772", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2018-06-18T11:19:15.000+0000", "created": "2018-06-18T03:31:19.000+0000", "labels": [ "alloy", "hyperloop", "ios" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2018-06-18T13:47:55.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "15000", "name": "Hyperloop" } ], "description": "In Hyperloop I have required and initiated a \"config class\" as part of the framework. The problem I have is that when I set an array to one of the config class variables it gets set to the class as a string and not an array, even when creating an NSArray it does not get set. The only workaround has been to set the value as a an array inside an array?! \r\n\r\nExample: `[[\"value1\",\"value2\"]]`\r\n\r\nSo I require the config class:\r\n\r\n{code:java}\r\n// require CountlyConfig\r\nvar CountlyConfigClass = require('Countly/CountlyConfig');\r\nvar CountlyConfig = new CountlyConfigClass();\r\n{code}\r\n\r\nI then set variables on the config class as follows, these work just fine:\r\n\r\n{code:java}\r\nCountlyConfig.appKey = \"123124\";\r\nCountlyConfig.host = \"http://www.host.com\";\r\n{code}\r\n\r\nThe problem happens when setting array as follows:\r\n\r\n{code:java}\r\nCountlyConfig.features = [\"crash\",\"views\"];\r\n{code}\r\n\r\nThis does not work as the Config class thows an error saying it expects an NSArray, after many hours I was able to set the value as follows:\r\n\r\n{code:java}\r\nCountlyConfig.features = [[\"crash\",\"views\"]];\r\n{code}\r\n\r\nSteps to reproduce:\r\n1. Create new alloy hyperloop enabled project\r\n2. In your podfile, add -> pod 'Countly', '18.04'\r\n3. In a alloy.js, put this:\r\n\r\n{code:java}\r\n// require CountlyConfig\r\nvar CountlyConfigClass = require('Countly/CountlyConfig');\r\nvar CountlyConfig = new CountlyConfigClass();\r\n\r\n// set config vars\r\nCountlyConfig.appKey = \"123124\";\r\nCountlyConfig.host = \"http://www.host.com\";\r\nCountlyConfig.features = [\"crash\",\"views\"];\r\n\r\n{code}\r\n\r\n4. Try and build project with the environment mentioned above\r\n\r\nPodfile:\r\n\r\n{code:java}\r\n# This is required for CocoaPods 1.x\r\ninstall! 'cocoapods',\r\n :integrate_targets => false\r\n \r\nplatform :ios, '8.0'\r\nuse_frameworks!\r\ntarget 'alloy-hyperloop' do\r\n pod 'Countly', '18.04'\r\n \r\nend\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Hyperloop iOS - Setting Array value to required Class setting string", "creator": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Hyperloop 3.0.5\r\n\r\nOperating System\r\nName = Mac OS X\r\nVersion = 10.13.2\r\nArchitecture = 64bit\r\n\r\nCPUs = 8\r\nMemory = 17179869184\r\nNode.js\r\nNode.js Version = 8.1.2\r\nnpm Version = 3.10.10\r\nTitanium CLI\r\nCLI Version = 5.1.0\r\nTitanium SDK\r\nSDK Version = 7.1.1.GA\r\nSDK Path = /Users/user/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA\r\nTarget Platform = iphone", "comment": { "comments": [ { "id": "438465", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "A (non-typed) JS-array is different to the (typed) native Array, e.g.\r\n{code:js}\r\nvar nativeArray = NSArray.arrayWithObjects('crash', 'views', null);\r\n{code}\r\nThe \"null\" is for terminating the variadic method structure.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-06-18T11:19:15.000+0000", "updated": "2018-06-18T11:19:15.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }