title: Corrupting Navgroups in Titanium Mobile
body: <p>In my app, people go from Window 1 to Window 2 to Window 3 etc, so the navigation goes:
  Window 1 -> Window 2 -> Window 3</p>
  
  <p>To go from one window to the next,I use a navigation group:</p>
  
  <pre><code>var main = Titanium.UI.createWindow({
      height:Ti.Platform.displayCaps.platformHeight,  
      width:Ti.Platform.displayCaps.platformWidth,  
      fullscreen:true, 
      navBarHidden : true,
  });
  
  var first = Ti.UI.createWindow({
      height:Ti.Platform.displayCaps.platformHeight,  
      width:Ti.Platform.displayCaps.platformWidth,  
      url:'main_windows/main.js',
      backButtonTitleImage : '../images/backb.gif',
      fullscreen:true, 
      navBarHidden : true,
  });
  
  var navGroup = Ti.UI.iPhone.createNavigationGroup({
      window:first
  });
  
  Ti.App.addEventListener('login', function(event)
  {
      var lwin = Ti.UI.createWindow({
          height:Ti.Platform.displayCaps.platformHeight,  
          width:Ti.Platform.displayCaps.platformWidth,  
          url:'main_windows/login.js',
          barImage: 'images/lback.gif', 
          fullscreen:true, 
          backgroundColor: '#f7f7f7',
          navBarHidden : false,
          _parent : Titanium.UI.currentWindow,
          navGroup : navGroup,
          rootWindow : first 
      });
  
      navGroup.open(lwin);
  });
  
  first.navGroup = navGroup;
  
  main.add(navGroup);
  
  main.open();
  </code></pre>
  
  <p>~~~</p>
  
  <p>Then in each window, I open the next window by doing the following:</p>
  
  <p>~~~</p>
  
  <pre><code>button1.addEventListener('click', function() {
      Ti.App.fireEvent('services', {
          zipcode : win.zipcode,
          user_id : win.user_id,
          user_uniqid : win.user_uniqid,
          user_name : win.user_name,
          user_email : win.user_email
      });
  });
  
  Ti.App.addEventListener('services', function(event) {
      var cwin = Titanium.UI.currentWindow;
      var swin = Titanium.UI.createWindow();
  
      swin.url = 'service.js';
  
      swin.zipcode = event.zipcode;
      swin.user_id = event.user_id;
      swin.user_uniqid = event.user_uniqid;
      swin.user_name = event.user_name;
      swin.user_email = event.user_email;
  
      swin.backgroundColor = '#f7f7f7';
  
      swin._parent = cwin;
      swin.navGroup = cwin.navGroup;
      swin.rootWindow = cwin.rootWindow;
      cwin.navGroup.open(swin);
  });
  </code></pre>
  
  <p>~~~</p>
  
  <p>This works well when people go from Window 1 -> Window 2 -> Window 3, but not when they go back:</p>
  
  <p>like from Window 1 -> Window 2 -> Window 3 -> Window 1 -> Window 2</p>
  
  <p>I get the following error when that happens: </p>
  
  <p>Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.</p>
  
  <p>What can I do to prevent this?</p>