Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3743] iOS: Closing a window containing a tableView causes the tableView data to be destroyed

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-05-25T16:27:35.000+0000
Affected Version/sRelease 1.6.2
Fix Version/sSprint 2011-21
ComponentsiOS
Labelsios, rplist, tableview, window
ReporterJon Alter
AssigneeBlain Hamon
Created2011-04-26T12:14:27.000+0000
Updated2011-05-25T16:27:35.000+0000

Description

If you close a window that contains a tableView, the tableView data will be destroyed, but the table is still intact. Step 1: run the example below Step 2: click the test button Step 3: notice the [object TiUITableViewSection] alert Step 4: click the open button Step 5: click the close button Step 6: click the test button Step 7: notice the TiUITableViewSection does not exist
var win1 = Ti.UI.createWindow({
	backgroundColor: 'green'
});

var data = [{title:"Row 1"},{title:"Row 2"}];
var table = Titanium.UI.createTableView({data:data});

var openButton = Ti.UI.createButton({
	title: 'Open',
	height: 50,
	width: 200,
});
openButton.addEventListener('click', function(e){
	var win2 = Ti.UI.createWindow({
		backgroundColor: 'blue'
	});

	win2.add(table);
	
	var closeButton = Ti.UI.createButton({
		title: 'Close',
		height: 50,
		width: 200,
		bottom: 70
	});
	closeButton.addEventListener('click', function(e){
		win2.close();
	});
	win2.add(closeButton);
	
	win2.open();
});

var testButton = Ti.UI.createButton({
	title: 'Test',
	height: 50,
	width: 200,
	bottom: 10
});
testButton.addEventListener('click', function(e){
	alert(table.data[0]);
	// alert(table);
});
win1.add(testButton);
win1.add(openButton);
win1.open();

Associated Helpdesk Ticket

http://appc.me/c/IBS-79527-881

Comments

  1. Blain Hamon 2011-05-24

    Time added elsewhere. See related bugs TIMOB-4196 and TIMOB-4062
  2. Natalie Huynh 2011-05-25

    Tested with 1.7.0.294b6aa...

JSON Source