Skip to content

Instantly share code, notes, and snippets.

@mattheworiordan
Created July 29, 2011 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattheworiordan/1113953 to your computer and use it in GitHub Desktop.
Save mattheworiordan/1113953 to your computer and use it in GitHub Desktop.
Use case for valueForUndefinedKey error raised on simple close call to Window
var win = Titanium.UI.createWindow({
fullscreen: true,
backgroundColor: '#666',
url: 'value_for_undefined_key_subwindow.js'
});
win.addEventListener('ready', function() {
// win.close causes an error only if called immediately after window is created
win.close();
});
var button = Titanium.UI.createButton({
title: 'Show Window',
width: 300,
height: 40
});
button.addEventListener('click', function() {
win.open();
});
var label = Titanium.UI.createLabel({
text: 'Press that button a few times and watch it crash',
color: '#000',
height: 'auto',
bottom: 40
});
Titanium.UI.currentWindow.add(label);
Titanium.UI.currentWindow.add(button);
Titanium.UI.currentWindow.fireEvent('ready');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment