Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-9400

iOS: Children are not removed from parents view hierarchy when context is shutdown

    Details

      Description

      Steps to reproduce
      Run the code.
      1. Open TableWindow
      2. Open Detail Window
      3. Back to Table Window
      4. Back to Main Window

      Repeat steps 1 through 4 till you see the table view blanked out

      Test code below.

      FILE: app.js

      Ti.UI.setBackgroundColor('#fff');
       
      var tabGroup = Ti.UI.createTabGroup();
       
      var winMain = Ti.UI.createWindow({
      	url: 'main.js',
      	title: 'Main Window'
      });
       
      var tab1 = Ti.UI.createTab({
      	window: winMain,
      	title: 'Main Window'
      })
       
      tabGroup.addTab(tab1);
      tabGroup.open();
      

      FILE: main.js

      var winTable = Ti.UI.createWindow({
      	url: 'table.js',
      	title: 'Table Window'
      });
       
      var button = Ti.UI.createButton({
      	title: 'Open Window with Table'
      });
       
      button.addEventListener('click', function(e) {
      	Ti.UI.currentTab.open(winTable, {animated: true});
      });
       
      Ti.UI.currentWindow.add(button);
      

      FILE: table.js

      var winDetail = Ti.UI.createWindow({
      	url: 'detail.js',
      	title: 'Detail Window'
      });
       
      var table = Ti.UI.createTableView();
       
      table.addEventListener('click', function(e) {
      	winDetail.sectionIndex = e.rowData.sectionIndex;
      	winDetail.rowIndex     = e.rowData.rowIndex;
      	Ti.UI.currentTab.open(winDetail, {animated: true});
      });
       
      Ti.UI.currentWindow.add(table);
       
      var data = [];
       
      for (var i = 0; i < 5; i++) {
      	data[i] = Ti.UI.createTableViewSection({
      		headerTitle: 'Section ' + i
      	});
      	
      	for (var j = 0; j < 5; j++) {
      		var row = Ti.UI.createTableViewRow({
      			className: 'row',
      			hasDetail: true,
      			sectionIndex: i,
      			rowIndex: j
      		});
      		
      		var container = Ti.UI.createView({
      			layout: 'vertical',
      			height: Ti.UI.SIZE,
      			top: 10,
      			left: 10,
      			bottom: 10,
      			right: 10
      		});
      		
      		container.add(Ti.UI.createLabel({
      			left: 0,
      			text: 'Label ' + j,
      			font: {
      				fontWeight: 'bold',
      				fontSize: 16
      			}
      		}));
      		
      		container.add(Ti.UI.createLabel({
      			top: 5,
      			left: 0,
      			text: 'Sub Label ' + j,
      			font: {
      				fontStyle: 'italic',
      				fontSize: 14
      			}
      		}));
      		
      		row.add(container);
      		data[i].add(row);
      	}
      	
      	table.setData(data);
      }
      

      FILE: detail.js

      var label = Ti.UI.createLabel({
      	text: 'Section: ' + Ti.UI.currentWindow.sectionIndex + ' Row: ' + Ti.UI.currentWindow.rowIndex
      });
       
      Ti.UI.currentWindow.add(label);
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vduggal Vishal Duggal (Inactive)
                Reporter:
                vduggal Vishal Duggal (Inactive)
              • Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Source Code