{ "id": "103924", "key": "TIMOB-11660", "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": "15105", "description": "2013 Sprint 07", "name": "2013 Sprint 07", "archived": true, "released": true, "releaseDate": "2013-04-08" } ], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2013-04-08T11:39:45.000+0000", "created": "2012-10-25T18:10:01.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "14137", "description": "Release 2.1.3", "name": "Release 2.1.3", "archived": true, "released": true, "releaseDate": "2012-10-03" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2015-06-11T15:08:17.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": "h3. Problem description\r\nString.format is crashing the app if the arguments are not strings\r\n\r\nh3. Steps to reproduce and sample code\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\ttitle:'test',\r\n\tbackgroundColor:'white',\r\n});\r\n\r\nvar cost = 10;\r\nvar coins = 20;\r\nvar message = String.format(L(\"menu_iconsbuy\"),cost,coins);\r\n\r\n// setting cost and coins as Strings, it works\r\n// var message = String.format(L(\"menu_iconsbuy\"),cost.toString(),coins.toString());\r\n\r\nTi.API.info('#### ' + message);\r\n\r\nwin.open();\r\n{code}\r\n\r\n\r\nstrings.xml (in the i18n folder) is:\r\n{code}\r\n\r\n\r\n\r\n\tThis icon set will cost %1$s coins.\\n You have %2$s coins\\nWant to buy it ?\r\n\r\n{code}\r\n\r\nThe workaround is to convert the numeric values to string: \r\nvar message = String.format(L(\"menu_iconsbuy\"),cost.toString(),coins.toString());\r\n\r\n\r\nAttached the crash log.", "attachment": [ { "id": "33166", "filename": "11660_log.txt", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-02T21:33:58.000+0000", "size": 486, "mimeType": "text/plain" } ], "flagged": false, "summary": "iOS: String.format crash with no feedback if the arguments are not strings", "creator": { "name": "alessioricco", "key": "alessioricco", "displayName": "alessio ricco", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 2.1.3 GA\r\nTiSDK 3.0 branch", "comment": { "comments": [ { "id": "246397", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue does not reproduces \r\n\r\nTested with\r\n\r\nTitanium Studio, build: 3.0.1.201212181159\r\nTitanium SDK version: 3.1.0 \r\nTitanium SDK version: 3.0.2 \r\niOS iPhone Simulator: iOS SDK version: 6.0", "updateAuthor": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-08T11:39:45.000+0000", "updated": "2013-04-08T11:39:45.000+0000" }, { "id": "246849", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Issue is not reproducible, Hence closing.\r\n\r\nVerified on:\r\nDevice : iPad 4, iOS version: 6\r\nSDK: 3.1.0.v20130409124549\r\nCLI version : 3.1.0-cr\r\nOS : MAC OSX 10.7.5\r\nAppcelerator Studio, build: 3.1.0.201304052347\r\nXCode : 4.5.1\r\n ", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-04-10T11:40:12.000+0000", "updated": "2013-04-10T11:40:12.000+0000" }, { "id": "354882", "author": { "name": "manuellehner", "key": "manuellehner", "displayName": "Manuel Lehner", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks. It just took me 2 hours to find that bug! {{value.toString()}} solved it.", "updateAuthor": { "name": "manuellehner", "key": "manuellehner", "displayName": "Manuel Lehner", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-06-11T15:08:17.000+0000", "updated": "2015-06-11T15:08:17.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }