[TIMOB-3743] iOS: Closing a window containing a tableView causes the tableView data to be destroyed
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-05-25T16:27:35.000+0000 |
Affected Version/s | Release 1.6.2 |
Fix Version/s | Sprint 2011-21 |
Components | iOS |
Labels | ios, rplist, tableview, window |
Reporter | Jon Alter |
Assignee | Blain Hamon |
Created | 2011-04-26T12:14:27.000+0000 |
Updated | 2011-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();
Time added elsewhere. See related bugs TIMOB-4196 and TIMOB-4062
Tested with 1.7.0.294b6aa...