Titanium Community Questions & Answer Archive

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

Modal Window crashes

Hi All

updated to 1.4.0 and running SDK 4.0 in the emulator. Im getting some weired things happening and current trying to log all the bugs i now have with my app.

Mainly databases driven tableviews randomly not populating and then when you go back the data is there. But the one which is crashing the app on click is this


var mapBtn = Titanium.UI.createButton({title:'View Map'});
win.rightNavButton = mapBtn;

mapBtn.addEventListener('click', function()
{    
    var w = Titanium.UI.createWindow({
        backgroundColor:'#336699',
        title:'Location',
        barColor:'#001336',
        url:'business_map_view.js',
    });
    var b = Titanium.UI.createButton({
        title:'Close',
        style:Titanium.UI.iPhone.SystemButtonStyle.PLAIN
    });
    w.setRightNavButton(b);
    b.addEventListener('click',function()
    {
        w.close();
    })
    w.open({modal:true});
});

What has changed to cause this to now crash?

Thanks

— asked August 2nd 2010 by Mark Pierce
  • create
  • iphone
  • modal
  • window
1 Comment
  • Mark, is it crashing when you click View Map the first time or only on subsequent clicks?

    — commented August 2nd 2010 by Goran Skledar

2 Answers

  • The code you posted works for me without crashes or errors, so I'm guessing something in business_map_view.js file is causing the crash.

    Are you creating a MapView in that file? If you do, does the app also crash if you comment out the MapView parts?

    — answered August 2nd 2010 by Goran Skledar
    permalink
    0 Comments
  • You were right! it was business_map_view.js. Database path had a space.! SUch a school boy error!

    Thank you.

    — answered August 2nd 2010 by Mark Pierce
    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.