{ "id": "165830", "key": "TIMOB-24383", "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": "19101", "name": "Hyperloop 2.1.0", "archived": false, "released": true, "releaseDate": "2017-04-28" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-04-19T07:22:13.000+0000", "created": "2017-02-08T02:44:52.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "18247", "name": "Hyperloop 2.0.0", "archived": false, "released": true, "releaseDate": "2016-10-18" } ], "issuelinks": [ { "id": "54222", "type": { "id": "10122", "name": "Gantt: start-finish", "inward": "is triggered by", "outward": "is triggering" }, "outwardIssue": { "id": "163246", "key": "TIMOB-23915", "fields": { "summary": "Hyperloop - iOS: Touch event properties and methods are undefined", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-04-19T22:34: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": "13715", "name": "Hyperloop", "description": "Hyperloop project" }, { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Objects that are added to {{NSArray}} or {{NSSet}} in native code and then retrieved via Hyperloop cannot properly be accessed. All properties are undefined and no methods can be called.\r\n\r\n*Steps to reproduce the behavior*\r\n1. Create a new classic app with Hyperloop enabled\r\n2. Extract the source contained in the attached zip file to project's {{src}} directory\r\n3. Place attached appc.js into the project root folder\r\n4. Add this code to app.js\r\n{code}\r\nvar Place = require('Test/Place');\r\nvar LikelihoodList = require('Test/LikelihoodList');\r\nvar l1 = new LikelihoodList();\r\n\r\nTi.API.debug('');\r\nTi.API.debug('### Test 1 ###');\r\nvar p0 = l1.place;\r\nTi.API.debug('Native - Single property');\r\nTi.API.debug('Retrieved object: ' + p0);\r\nTi.API.debug('Name property: ' + p0.name);\r\n\r\nTi.API.debug('');\r\nTi.API.debug('### Test 2 ###');\r\nvar p1 = Place.cast(l1.likelihoods.objectAtIndex(0));\r\nTi.API.debug('Native - Added to NSArray');\r\nTi.API.debug('Retrieved object: ' + p1);\r\nTi.API.debug('Name property: ' + p1.name);\r\n\r\nvar NSMutableArray = require('Foundation/NSMutableArray');\r\nvar NSArray = require('Foundation/NSArray');\r\nvar l2 = new NSMutableArray();\r\nTi.API.debug('');\r\nTi.API.debug('### Test 3 ###');\r\nvar p = Place.alloc().initWithNameAndRating(\"Test2\", 1.0);\r\nl2.addObject(p);\r\nvar p2 = Place.cast(l2.objectAtIndex(0));\r\nTi.API.debug('HL - Create new array, add place and retrieve');\r\nTi.API.debug('Retrieved object: ' + p2);\r\nTi.API.debug('Name property: ' + p2.name);\r\n\r\nTi.API.debug('');\r\nTi.API.debug('### Test 4 ###');\r\nvar l3 = new NSMutableArray();\r\nl1.fill(l3);\r\nvar p3 = Place.cast(l3.objectAtIndex(0));\r\nTi.API.debug('HL/Native - Create new array (HL) and add place (Native)');\r\nTi.API.debug('Retrieved object: ' + p3);\r\nTi.API.debug('Name property: ' + p3.name);\r\n{code}\r\n\r\n*Actual behavior*\r\nTest cases 2 and 4 show {{Name property: undefined}} because the object has no methods or properties mapped.\r\n\r\n*Expected behavior*\r\nAll test cases print the value of the object's name property", "attachment": [ { "id": "61857", "filename": "appc.js", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-03-15T02:01:12.000+0000", "size": 302, "mimeType": "text/javascript" }, { "id": "61856", "filename": "Test.zip", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-03-15T02:01:55.000+0000", "size": 1497, "mimeType": "application/zip" } ], "flagged": false, "summary": "Hyperloop: iOS - Objects returned from NSArray/NSSet unusable", "creator": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "environment": "appc-cli 6.1.0\r\nTiSDK: 6.0.1.GA\r\nHyperloop: 2.0.0", "closedSprints": [ { "id": 871, "state": "closed", "name": "2017 Sprint 08 SDK", "startDate": "2017-04-10T15:40:31.217Z", "endDate": "2017-04-24T15:40:00.000Z", "completeDate": "2017-04-23T21:46:37.098Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "417600", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR (master): https://github.com/appcelerator/hyperloop.next/pull/157\r\nPR (2_1_X): https://github.com/appcelerator/hyperloop.next/pull/158", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-04-18T17:12:03.000+0000", "updated": "2017-04-18T17:12:03.000+0000" }, { "id": "417725", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with this environment:\r\nNode Version: 6.10.1\r\nNPM Version: 3.10.10\r\nMac OS: 10.12.4\r\nAppc CLI: 6.2.0\r\nAppc CLI NPM: 4.2.9\r\nTitanium SDK version: 6.0.3.GA\r\nAppcelerator Studio, build: 4.8.1.201612050850\r\nXcode 8.2.1\r\nHyperloop 2.1.0 4/19 commit *1bd4\r\n\r\nI tested with the above environment, and with the demo code shown in the description. I created an src folder at the root, and extracted the appropriate zip. Testcase #2 and #4 now print's values of the object property names:\r\n{code}\r\n[DEBUG] : ### Test 2 ###\r\n[DEBUG] : Loading: /Users/amukherjee/Library/Developer/CoreSimulator/Devices/94D3E5A3-6FAE-4907-A16E-CC9EE3E87B77/data/Containers/Bundle/Application/585C37A0-790F-4118-8D25-8A3932C387EC/test2.app/hyperloop/foundation/nsobject, Resource: hyperloop/foundation/nsobject\r\n[DEBUG] : Loading: /Users/amukherjee/Library/Developer/CoreSimulator/Devices/94D3E5A3-6FAE-4907-A16E-CC9EE3E87B77/data/Containers/Bundle/Application/585C37A0-790F-4118-8D25-8A3932C387EC/test2.app/hyperloop/foundation/nsobject.js, Resource: hyperloop/foundation/nsobject_js\r\n[DEBUG] : Native - Added to NSArray\r\n[DEBUG] : Retrieved object: \r\n[DEBUG] : Name property: Test1\r\n.\r\n.\r\n.\r\n[DEBUG] : ### Test 4 ###\r\n[DEBUG] : HL/Native - Create new array (HL) and add place (Native)\r\n[DEBUG] : Retrieved object: \r\n[DEBUG] : Name property: Test5\r\n{code}\r\n", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-04-19T22:32:31.000+0000", "updated": "2017-04-19T22:32:31.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }