newSpinner not spinning...

And on the topic of the missing (), it’s OK to omit them in this case.  It’s a syntactic sugar feature of Lua that if the only argument you pass to a function is a new table, then you can omit the () and go straight to the {}.  See section 2.5.8 here: http://www.lua.org/manual/5.1/manual.html.

  • Andrew

Looks like start() does the trick - can’t believe that is undocumented!

Looks like it’s documented here: http://docs.coronalabs.com/api/type/SpinnerWidget/index.html.  But admittedly it’s a little hard to get to this page from the page on widget.newSpinner().

  • Andrew

Ahh - good pickup - I only looked at http://docs.coronalabs.com/api/library/widget/newSpinner.html - would be nice to have a Gotcha on that page to link the two, or have the sample code at the bottom actually include it so it runs correctly!

Nathan.

Forgot all about sugar. However I don’t think it should be used in examples in the docs. It could be confusing to beginners as it was to me

Forgot all about sugar. However I don’t think it should be used in examples in the docs. It could be confusing to beginners as it was to me

I think you’re right about the official examples. And while I’ve been doing it the “shorthand” way in my examples, I’m going to quit and add the parens. It makes more sense to keep things equal, I think.

 Jay