DHennrich, Ti.API.info( timer )
returns 2000 doesn't mean that 2000 is a type of number. Actually it is a string since you're using setString method to store the value and retrieve it using getString()
. When you use setString
it stores the value as a string and getString
always returns a string avlue. That's why your code worked when you used 2000 instead of timer
variable.
From API Documentation
getString( String property, [String default] ) : String
Returns the value of a property as a string data type. Parameters
property : String Name of property. default : String (optional) Default value to return if property does not exist.
Returns
String
You can use setInt or setDouble instead of setString
to set a property and to retrieve use getInt or getDouble respectively.
Try to store the value using Ti.App.Properties.setInt( 'pushTime', timer );
and you can retrieve the value using
var timer = Ti.App.Properties.getInt( 'pushTime' );
I hope it resolved your issue.