Archive

Archive for October, 2010

Appcelerator Titanium.include Simulator Works, Device Fails

October 15, 2010 Leave a comment

I’ve been writing a lot of mobile apps for KeyLimeTie, which means I’ve been working with Appcelerator Titanium a lot. The basis of the platform is you write a bunch of javascript, using the “Titanium” namespaces to build up your native iOS and Android app. One particular feature is “Titanium.include(‘myfile.js’);”, which acts just like a PHP include(‘myfile.php’)–inlines whatever code is in the file and runs it.

Here’s where I hit some trouble, and wasted a couple of hours of my time. Everything was working in the iPhone simulator, but when I would deploy to my iPad for testing, the program would hang at the loading screen. Through liberal use of alert(“I made it this far!”), I was able to figure out that a function wasn’t getting included from one of my Titanium.include’d files. In fact, the file wasn’t getting included at all.

The solution? I had messed up the capitalization in my include statement. My file was named Foo.js, and I was trying to include foo.js. The simulator was smart enough to work this out, but the device failed to do so.

Moral of the story? Always check caps.

Categories: Uncategorized
Follow

Get every new post delivered to your Inbox.