收录日期:2019/12/11 02:48:57 时间:2010-10-28 14:33:36 标签:iphone,android,titanium

I am planning to develop an application using Titanium Framework for iPhone and Android. Can someone list the best practices, do's and don'ts for the development using your experience with the framework?

this is more of a tip then anything but so far my favorite function has been the tt.os in tweetanium that handles passing of vars of functions to the correct platform.

and an example of how they use it

First of all, there's the Appcelerator guide on Titanium's best practices: https://wiki.appcelerator.org/display/guides/Mobile+Best+Practices A working link to the Tweetanium repo is here: https://github.com/appcelerator-titans/tweetanium

Titanium is still quite a young platform and unfortunately there doesn't seem to be much of a discussion about best practices. The main reference to best practices in Titanium is Tweetanium, as @bh88 states.

http://blog.krawaller.se/ is a blog from two swedish Titanium developers who are actively thinking and discussing Titanium. They've written about Tweetanium and how it influenced their style, they also write about using Coffeescript in Titanium and they've created their own framework for Titanium: http://kraniumjs.com/

Memory Leaks: Keeping the global scope clean is important to prevent memory leaks. That's why you'll see that the tweetanium project is full of self-executing functions. Appcelerator also have a couple of videos on vimeo from their Codestrong Conference, one in which Rick Bialock explains the most common mistakes that result in Memory leaks: http://vimeo.com/29804284