Titanium Mobile: [Best Practice] - For a Ti.UI.Window which you may need to frequently switching, for example, a CHAT window in an IM. Is it good to keep opening/closing ONE window and kept changing its content? OR is it good to create say 4, 5 of these windows?
-
1 consideration is, usually one only talks to less than 5, 6 people in one activity circle. So even if we create 1 chat window for each, we only create, say 6 windows, at most. And we only "open" 1 of them at any time. 2nd consideration is, since we only open 1 chat window at any time anyway, so why not just keep 1 window and re-render its content everytime it opens?
-
Answer:
Windows make many developers nervous, but i'm all too fond of them. As long as you understand the basics of closing and nullifying Windows, you'll never run into Memory leaks. For what you're wanting, i don't foresee too much of an issue running 5-6 windows, but it will depend on the amount of controls used within Windows. My recommendation though is: Use 1 Window and manage the Data Model in a separate commonJS file. One of the pros of using commonJS is that it remains in Memory even though you feel like you're re-initializing it from scratch. Keep the multiple instances of Chat data in this commonJS file and load them when relevant to your Window.
John Jardin at Quora Visit the source
Related Q & A:
- If you were to start using a Wordpress framework today, which one would you use?Best solution by WordPress
- What is the best practice for free space for a SQL server database drive?Best solution by Database Administrators
- How to open a new window in windows form application?Best solution by Stack Overflow
- Why isn't the text displayed in my Yahoo IM chat window?Best solution by in.answers.yahoo.com
- How do you stop Yahoo from opening links in a new window?Best solution by answers.yahoo.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.