Created
July 29, 2011 14:44
-
-
Save mattheworiordan/1113953 to your computer and use it in GitHub Desktop.
Use case for valueForUndefinedKey error raised on simple close call to Window
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Titanium.UI.currentWindow.fireEvent('ready'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment