Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18391] iOS: Using String.format with multiple parameters crashes application

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-03-20T23:41:17.000+0000
Affected Version/sRelease 3.5.0
Fix Version/sRelease 4.0.0, Release 4.1.0
ComponentsiOS
Labelsn/a
ReporterMauro Piccotti
AssigneeJon Alter
Created2015-01-15T15:21:28.000+0000
Updated2015-04-27T16:36:31.000+0000

Description

Behaviour of this bug is very strange, in other occasions I had problems with String.format and parameters, but this one worked until this morning, before upgrading to 3.5. Inside strings.xml: Si prega di aggiornare l'app alla versione %s (versione corrente %s) Everywhere, even in index.js: Ti.API.debug(L('msgAppUpdateAvailable')); Ti.API.debug(String.format("Si prega di aggiornare l'app alla versione %s (versione corrente %s)", Ti.App.version, Ti.App.version)); Ti.API.debug("PORCODDIO"); Ti.API.debug(String.format(L('msgAppUpdateAvailable'), Ti.App.version, Ti.App.version)); If I remove second %s and second parameters it works. Console: [DEBUG] : Si prega di aggiornare l'app alla versione %@ (versione corrente %@) [DEBUG] : Si prega di aggiornare l'app alla versione 1.8 (versione corrente 1.8 [DEBUG] : PORCODDIO [DEBUG] : [ioslib] [ios-sim] [DEBUG] Session did end with error (null) [DEBUG] : [ioslib] [ios-sim] [DEBUG] Removing named pipe at /var/folders/js/k7c7r3m95fz8gpq0gf51hz0c0000gn/T//ios-sim-stderr-pipe-1421334682' [DEBUG] : [ioslib] [ios-sim] [DEBUG] Removing named pipe at /var/folders/js/k7c7r3m95fz8gpq0gf51hz0c0000gn/T//ios-sim-stdout-pipe-1421334682' [DEBUG] : [ioslib] [ios-sim] Exited with code: 0

Comments

  1. Anthony Njuguna 2015-03-17

    Is there a current workaround? Experiencing same issue when String.Formart is used with more than one argument. The App suddenly crashes with no warning Issue found when upgraded project to 3.5.x
  2. Jon Alter 2015-03-20

    PR: master: https://github.com/appcelerator/titanium_mobile/pull/6737 4_0_X: https://github.com/appcelerator/titanium_mobile/pull/6738
  3. Ewan Harris 2015-03-25

    Verified fix using: Mac OSX 10.10.2 Titanium SDK build: 4.0.0.v20150323131014 Titanium CLI, build: 4.0.0-alpha Alloy: 1.6.0-alpha Xcode 6.2 iOS 8.2 Simulator Using the attached code built to device, the app no longer crashes. Closing ticket.

JSON Source