title: Titanium can't remove child view
body: <p>I have a <code>ScrollView</code> which I am adding multiple <code>View</code>'s into using this code:</p>
  
  <pre><code>payload = {
      booking : b,
      duration: duration,
      removeBooking: function(view_to_remove) {
          removeBooking(view_to_remove);
      },
      updateBooking: function(view_to_remove, new_booking) {
          removeBooking(view_to_remove);
          overlayBooking(new_booking);
      }
  };
  
  booking = Alloy.createController('appointments_bookable_booking', payload).getView(); // returns a View
  $.intervals_container.add(booking); // this is adding a View into a ScrollView
  ...
  </code></pre>
  
  <p><code>removeBooking()</code> then gets executed later on as a callback. I am then trying to remove the single <code>View</code> like this:</p>
  
  <pre><code>function removeBooking(booking_view) {
  
      for (var i = $.intervals_container.children.length - 1; i &gt;= 0; i--) {
          if(booking_view === $.intervals_container.children[i]) {
              Ti.API.info('Found a match');
              $.intervals_container.remove($.intervals_container.children[i]);
          }
      };
  
  }
  </code></pre>
  
  <p>I'm looping through the children just to show the view I'm trying to remove DOES actually exist in the children views array. I do get the 'Found a match' printed to my console but the view is never actually removed.</p>
  
  <p>There are other views being added into the <code>ScrollView</code> as well. If I loop through the <code>intervals_container.children</code> and remove each one. The other views are removed apart from the ones created using the code above.</p>
  
  <p>Can anyone see why I can't remove the view?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>After trying ericfreshz'a answer I can remove ALL the views however this is not working to remove one:</p>
  
  <pre><code>if ($.intervals_container.children) {
          var _viewCount = $.intervals_container.children.length;
          for ( s = 0; s &lt; _viewCount; s++) {
              if($.intervals_container.children[((_viewCount - 1) - s)] === booking_view) {
                  Ti.API.info('Removing view');
                  $.intervals_container.remove($.intervals_container.children[((_viewCount - 1) - s)]);
              }
      }
  }
  </code></pre>
  
  <p>This should only remove the view which has been passed into the function but it doesn't. I get "Removing view" in my console but the view isn't removed.</p>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>I did an experiment to see if the scrollview was actually changed and it turns out the view is actually removed as the number of children views actually decreases however the view is still visible.</p>
  
  <pre><code>Ti.API.info('Count BEFORE: ' + $.intervals_container.children.length);
  
  $.intervals_container.remove(booking_view);
  
  Ti.API.info('Count AFTER: ' + $.intervals_container.children.length);
  </code></pre>
  
  <p>The result is one less.</p>