Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

iPad crash or how to catch this

Hi, first of all Titanium is a wonderful software, thank You for it.

This shall be a small app for our customer, some kind of eBook, he wants just to swipe through pages.
So nothing really special about this, working perfectly in iPad simulator, but crashing after random swipe actions.
Somebody an idea ?

Thanks

Now shortly to my problem:

var scrollData = [];
for (i=0; i<=199; i++) {        
    var myV = Titanium.UI.createImageView({
        top: 0,
        height:fullSight,
        width: 1024,
        image: 'book/' + bigChapter[i] + '.jpg'
    });
    checkSpecialPage(i);
     v.push(myV);
     scrollData.push(v[i]);    
}
var allChapters = v;

var view1 = Titanium.UI.createScrollableView({
    views: scrollData,
    backgroundColor:'#FFF',
    showPagingControl:false,
    pagingControlHeight:30,
    maxZoomScale:2.0,
    currentPage:0,
        showVerticalScrollIndicator:false,
        showHorizontalScrollIndicator:false
});
controllerWindow.add(view1);
— asked September 3rd 2010 by Martin von Wysiecki
  • crash
  • ipad
  • scrollableview
0 Comments

1 Answer

  • I think it's a memory issue, you are creating way more views (199).
    You might want consider creating the views "by request", or reuse them somehow.
    Take a look at this:

    https://gist.github.com/810171

    — answered January 9th 2012 by Dan Tamas
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.