App Crashes. How improve stability of iPhone Apps?
Hello all,
I have some issues with the stability of my titanium iphone app. It crashes randomly. But i can´t reproduce the crashes in detail. But the crashes mostly occur when using a slider that causes many labels to change its values. Also when scrolling in a table view where each row contains controls and labels. Each row can be added dynamically. And writing/reading to/from the memory of the iphone via Titanium.App.Properties.setList are the most commen tasks in my application.
Are there any tips in general how to avoid the crashes? It sounds to me like memory leak issues, because the crashes occur randomly. Can I do some memory management in my app? Is there a Garbage Collection in Titanium?
It it important to fix this javascript warnings? 'functionname' was used before it was defined.
many thx for your help,
florian
5 Answers
-
Hi Florian,
I have the same problem with (customized) table views.
I also noticed that if a window is being closed, children of that window are not being destroyed…
I hope that you get a answer…
-
Hi
For custom tableviews, are you sure you set the className ? this is very important, and is telling the OS to render the rows using the same template for the same type of rows, to improve the memory and cpu usage.
-
hey Tamas,
you mean every row that has the same structure should have the same className? that would be a good point! i have a lot of tables and rows…
many thx,
florian -
I also see some crashes in my table rows but when I give each of them a unique classname, even all of them have same layout and structure, it became more stable…. kind of opposite of what Tamas said…. I wonder why?
-
Hello, the className hint helped a lot. The app is much more stable now. I used same className for rows that have the same layout. But sometimes crashes still occur. My application is tab-based. In 2 tabs i have basically table views with many rows and hasChild true. Sometimes you must click "back" 5 times to arrive at the top level table view again. I guess all top windows then are still in memory. Perhaps it could be a good idea to navigate back to top level table view to make the children ready for "garbage collection". Or just create the tab windows when they are needed. I will give it a try. thx, florian