TitaniumのTi.UI.currentWindowという概念がよくわからない
最近、仕事でTitaniumを使っているんですがTi.UI.currentWindowの動作がいまいちわからない・・・
今、手元にTitaniumがないのでコード間違ってるかもしれませんが・・・
app.js
var win = Ti.UI.cureateWindow(); win.addEventListener('click', function() { var next = Ti.UI.cureateWindow({ url: 'next.js', title: 'next' }); next.open(); }); win.open(); Ti.API.info('currentWindow:' + Ti.UI.currentWindow);
next.js
TiAPI.info('currentWindow:' + Ti.UI.currentWindow.title);
実行してみると
currentWindow:undefined
currentWindow:next
え?なんで上のほうがundefinedなの?win.open()してるのに・・・
どういうことなんだ・・・