{ "id": "162058", "key": "TIMOB-23681", "fields": { "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "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": [], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-12-11T22:49:15.000+0000", "created": "2016-07-26T01:02:02.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "hyperloop" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-12-11T22:49:15.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" } ], "description": "h6.Reproduce\r\n1. If you have following method in custom SDK.\r\n{code:title=TestLib.h}\r\n#import \r\n\r\n@interface TestLib : NSObject \r\n\r\n// Takes pointer to NSInteger as third argument to store result\r\n+(void)addNumber: (NSInteger)num1 with:(NSInteger)num2 result:(NSInteger*)result;\r\n\r\n@end\r\n{code}\r\n2. And call it in a app like following\r\n{code}\r\nvar result = 0;\r\n\t\r\n TestLib.addNumberWithResult(1, 2, result); // throws [NSInvocation setArgument:atIndex:]: NULL address argument error\r\n \t\t\t\t\t\t\t\t\t\t // TestLib expects a pointer to NSInteger as third argument\r\n alert('Result: ' + result);\r\n{code}\r\n\r\n3.Then you will get error like following which seems hyperloop do not recognise the pointer to NSIntege or NSUInteger.\r\n{code}\r\n-[NSInvocation setArgument:atIndex:]: NULL address argument \r\n[ERROR] : Script Error { \r\n[ERROR] : column = 26; \r\n[ERROR] : description = \"-[NSInvocation setArgument:atIndex:]: NULL address argument\"; \r\n[ERROR] : line = 98; \r\n[ERROR] : message = \"-[NSInvocation setArgument:atIndex:]: NULL address argument\"; \r\n[ERROR] : name = NSInvalidArgumentException; \r\n{code}\r\n\r\nh6.Note\r\nNote sure is this expected. If yes, please change this to a feature request ticket since customer try to use a RSA SDK, but can't do it because of the above issue.", "attachment": [], "flagged": false, "summary": "Hyperloop: NSInteger or NSUInteger are not working well", "creator": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "subtasks": [], "reporter": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "environment": null, "comment": { "comments": [ { "id": "400004", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hmm. The method uses a pointer to NSInteger as the third parameter, which is unconventional. I think Hyperloop presumes you use the iOS api with objective C in a conventional way.\r\nyou can't exactly assign a {{var result}} to a pointer. and so it errors out.\r\nIt's expected behavior, unless there's someway using nodeJS you give result as a memory address or pointer. [~hansknoechel] thoughts?", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-10-28T02:21:40.000+0000", "updated": "2016-10-28T02:21:40.000+0000" }, { "id": "405119", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "[~hansknoechel] [~jvennemann]\r\n\r\nPlease update this. Thanks.", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2017-01-24T00:12:41.000+0000", "updated": "2017-01-24T00:12:41.000+0000" }, { "id": "405169", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~sliang], as Kiat already mentioned, Javascript doesn't support the concept of pointers like in C-style languages, so what the customer is trying to achieve in his example is not possible. Although Javascript passes objects in a pass-by-reference style there is now way to control that. Primitive values like integers are always passed by value hence invoking a native function which uses a pointer to pass a primitive value back to it's calling context won't work.\r\nPlease note that this only applies to primitive values. Objects created with Hyperloop proxy classes like {{var view = new UIView()}} can be modified and those changes will be available in the calling context.\r\nTo workaround this limitation the customer has make use of return values instead of pointers for primitive values.", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-01-24T13:47:28.000+0000", "updated": "2017-01-24T13:50:35.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }