{ "id": "80546", "key": "TIMOB-5353", "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": "12090", "description": "", "name": "Sprint 2011-50", "archived": true, "released": true, "releaseDate": "2011-12-19" }, { "id": "12677", "description": "Release 1.8 Service Pack 1", "name": "Release 1.8.1", "archived": true, "released": true, "releaseDate": "2012-01-31" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-03-26T06:57:11.000+0000", "created": "2011-09-23T02:58:32.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "module_tabgroup", "qe-testadded" ], "versions": [ { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" }, { "id": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" } ], "issuelinks": [ { "id": "14940", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "85878", "key": "TIMOB-7529", "fields": { "summary": "Android: Titanium.UI.TabGroup: addTab with Label argument crashes app", "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": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-03-26T06:57:11.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": "h1. Problem\r\nIn several of the macros defined in TiBase.h, the log warnings about \"expected: type, was: x\" are backwards. They will show the actual type beside \"expected\" and the expected type beside \"actual\".\r\n\r\nh2. Pull Request\r\nhttps://github.com/appcelerator/titanium_mobile/pull/490\r\n\r\nh2. Error Message\r\nWhen I tried to pass a label to a tab group's addTab method, I see the following. Note how expected and was are switched?\r\n{code:title=Error Message}\r\n[ERROR] Invalid type passed to function. expected: TiUILabelProxy, was: TiUITabProxy in -[TiUITabGroupProxy addTab:] (TiUITabGroupProxy.m:65)\r\n{code}\r\n\r\nh2. Reproduction\r\nDrop the following in your app.js, and run it. The app will crash (as it should... we're adding a label to a tab group!) but you will notice the erroneous log message right before the nasty exceptions are thrown.\r\n{code:title=app.js}\r\nvar tabs = Ti.UI.createTabGroup();\r\ntabs.addTab(Ti.UI.createLabel());\r\ntabs.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: In TiBase.h, \"expected\" and \"was\" Are Frequently Backwards", "creator": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "environment": null, "comment": { "comments": [ { "id": "166723", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "Added a pull request.", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-09-23T03:04:12.000+0000", "updated": "2011-09-23T03:04:12.000+0000" }, { "id": "175809", "author": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Bug still valid (conditionally), verified on:\r\nSDK: 1.8.0.v20111010114849\r\nStudio: 1.0.7.201112120322\r\nOS: OS X Lion\r\n\r\nThere are three different scenarios, each having a different result:\r\n\r\nI. Building and running to device.\r\nII. Building to device, running in simulator.\r\nIII. Building and running to simulator.\r\n\r\nI. Building and running to device (with one exception).\r\n\r\nDevices: iPhone/iPad 4.3.5, iPhone 5.0.1, iPhone Simulator 5.0 (run after building to device)\r\n\r\nLog: [ERROR] Script Error = invalid method (createTabGroup) passed to UIModule at app.js (line 1).\r\n\r\nII. Building to device, running in simulator (after a few runs, behavior I is exhibited).\r\n\r\nDevices: iPhone Simulator 4.3, iPad Simulator 4.3/5.0\r\n\r\nLog: \r\n\r\nIII. Building and running to simulator. This is the original incorrect behavior.\r\n\r\nDevices: iPhone/iPad Simulator 4.3/5.0\r\n\r\nLog: [ERROR] Invalid type passed to function. expected: TiUILabelProxy, was: TiUITabProxy in -[TiUITabGroupProxy addTab:] (TiUITabGroupProxy.m:65)", "updateAuthor": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-12T13:25:22.000+0000", "updated": "2011-12-12T13:25:22.000+0000" }, { "id": "176150", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Couldn't recreate the crash or issues, but did notice one related error that slipped through the cracks. This one would be recreated by\r\n\r\n{code}\r\n\r\nvar foo = Ti.UI.createEmailDialog({toRecipients:5});\r\nfoo.open();\r\n\r\n{code}", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-14T15:24:59.000+0000", "updated": "2011-12-14T15:27:41.000+0000" }, { "id": "179199", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 1.9.0.v20120112104633\r\nFirst Case:\r\n[ERROR] Invalid type passed to function. expected: TiUITabProxy, was: TiUILabelProxy in -[TiUITabGroupProxy addTab:] (TiUITabGroupProxy.m:65)\r\n\r\nSecond Case:\r\n[ERROR] Invalid type passed to function. expected: NSArray or nil, was: __NSCFNumber in -[TiUIEmailDialogProxy open:] (TiUIEmailDialogProxy.m:64)\r\n\r\nNeed to be tested on Simulator to see the expected and was", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-13T10:26:28.000+0000", "updated": "2012-01-13T10:26:28.000+0000" }, { "id": "238322", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Running the app, no exception occurred.\r\n\r\nTested on:\r\nStudio : 3.0.2.201302041757\r\nSDK version: 3.0.2.v20130207164659\r\nDevice : Google Nexus, android : 4.1\r\nActual:\r\nNo exception occur\r\n\r\nExcepted:\r\nA classCastException should occur.\r\nE/TiApplication(8640): (main) \\[5973,6039\\] Sending event: exception on thread: main msg:java.lang.ClassCastException: ti.modules.titanium.ui.LabelProxy; Titanium 1.8.1,2012/01/27 17:31,a24502a\r\nE/TiApplication(8640): java.lang.ClassCastException: ti.modules.titanium.ui.LabelProxy\r\n", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-02-13T07:34:54.000+0000", "updated": "2013-02-13T07:34:54.000+0000" }, { "id": "244046", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Confused: Why is an android test used to reopen an iOS bug?", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-26T00:04:15.000+0000", "updated": "2013-03-26T00:04:15.000+0000" }, { "id": "244047", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Paras, since this is an iOS bug, we need to open a new bug for android (especially when the noted issue is fixed). So... please confirm this works on ios, and fi so close. AT that point, go ahead and log a new issue for android. Let Dustin or myself know if this is not clear. thanks!\n", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-26T00:07:47.000+0000", "updated": "2013-03-26T00:07:47.000+0000" }, { "id": "244078", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "App doesn't crash and error message is reported as expected.Hence closing the issue.\r\nError message comes as \r\nInvalid type passed to function at app.js\r\n\r\nLog on the console\r\n[ERROR] Script Error {\r\n backtrace = \"#0 () at :0\";\r\n line = 56;\r\n message = \"Invalid type passed to function\";\r\n nativeLocation = \"-[TiUITabGroupProxy addTab:] (TiUITabGroupProxy.m:78)\";\r\n nativeReason = \"expected: TiUITabProxy, was: TiUILabelProxy\";\r\n sourceId = 303212608;\r\n sourceURL = \"file://localhost/Users/global/Library/Application%20Support/iPhone%20Simulator/6.1/Applications/B4AB833B-8CB1-4070-A98A-CF7E91C45780/abc.app/app.js\";\r\n}\r\n\r\nTested on:\r\niOS version: 6\r\nStudio : 3.0.2.201302041757\r\nSDK version: 3.1.0.v20130325155928\r\n", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-03-26T06:57:11.000+0000", "updated": "2013-03-26T06:57:11.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }