Skip to content

Instantly share code, notes, and snippets.

@joelhooks
Created June 10, 2010 04:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joelhooks/432553 to your computer and use it in GitHub Desktop.
Save joelhooks/432553 to your computer and use it in GitHub Desktop.
//in draw() - the label bits were throwing an error with
//standard value objects with a toString complaining that
//there was no label property before it hit the else.
//I thought the string test was repetitive, since the
//_data.toString() covers that too, but the property check
//is what let me compile my app.
if(_data.hasOwnProperty("label") && _data["label"] is String)
{
_label.text = _data.label;
}
else
{
_label.text = _data.toString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment