Hi there,
As iOS7 and a new Titanium SDK is publicly available, I've tried to switch from NavigationGroup to NavigationWindow as the former one will be deprecated, but unfortunately I had no success. I really tried everything (updating the SDK & Alloy, diggin through this forum, trying a lot of variations in the code), but it seems that the problem is not specific to my app.
I've created a brand new Alloy based, empty project in Titanium, and changed two files as follows:
views/index.xml:
<Alloy> <NavigationWindow platform="ios"> <Window id="win2" title="Test" backgroundColor="green"> <Label>Hi there</Label> </Window> </NavigationWindow> </Alloy>controllers/index.js:
$.index.open();So nothing special - yet, no success.
Console log:
[ERROR] : Script Error { [ERROR] : backtrace = "#0 () at file:///Users/Szabi/Library/Application%20Support/iPhone%20Simulator/7.0/Applications/B6D79D17-8E4F-4D23-B1C2-AC8D042DD22B/NavigationWindow%20tesst.app/alloy.js:214"; [ERROR] : line = 24; [ERROR] : message = "'undefined' is not a function (evaluating 'Ti.UI.iOS.createNavigationWindow({\n window: $.__views.win2,\n id: \"index\"\n })')"; [ERROR] : name = TypeError; [ERROR] : sourceId = 232053376; [ERROR] : sourceURL = "file:///Users/Szabi/Library/Application%20Support/iPhone%20Simulator/7.0/Applications/B6D79D17-8E4F-4D23-B1C2-AC8D042DD22B/NavigationWindow%20tesst.app/alloy/controllers/index.js"; [ERROR] : }The compiled JS code looks ok for me:
function Controller() { require("alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments)); this.__controllerPath = "index"; arguments[0] ? arguments[0]["__parentSymbol"] : null; arguments[0] ? arguments[0]["$model"] : null; arguments[0] ? arguments[0]["__itemTemplate"] : null; var $ = this; var exports = {}; $.__views.win2 = Ti.UI.createWindow({ id: "win2", title: "Test", backgroundColor: "green" }); $.__views.__alloyId1 = Ti.UI.createLabel({ width: Ti.UI.SIZE, height: Ti.UI.SIZE, color: "#000", text: "Hi there", id: "__alloyId1" }); $.__views.win2.add($.__views.__alloyId1); $.__views.index = Ti.UI.iOS.createNavigationWindow({ window: $.__views.win2, id: "index" }); $.__views.index && $.addTopLevelView($.__views.index); exports.destroy = function() {}; _.extend($, $.__views); $.index.open(); _.extend($, exports); } var Alloy = require("alloy"), Backbone = Alloy.Backbone, _ = Alloy._; module.exports = Controller;Important versions:
Host OS: Mac OS X OS Version: 10.8.5 OS Arch: x86 JRE Version: 1.6.0_51 Titanium Studio Version: 3.1.3.201309132423 XCode Version: 5.0 Latest Titanium SDK: 3.1.4.v20130918151553 alloy@1.2.2Do you have any suggestion on what have I done wrong? Or maybe there is a hidden bug in the SDK?
Thank you guys!