I have a NavigationWindow in which I am opening and closing another window by swiping to left to open the first and then to the right to close it and return to the child window of the NavigationWindow. That bit works fine.
What is causing the issue is that I have some buttons on the child window and if at the start of a swipe one catches one of these buttons, enough to cause it to highlight, the app will crash on the Simulator and device with the error:
The application has crashed with an uncaught exception 'NSInvalidArgumentException'. Reason: [ERROR] : -[TiUIButton allTouches]: unrecognized selector sent to instance 0xca8f290
I've boiled my code down to the bare bones and have a test case here and would be interested to get some feedback on what could be causing this. Although by studying the error it seems that the 'allTouches' event in Titanium's TiUIButton.m class has something to do with the matter!
Thanks.
Patrick
OSX 10.8.5 iOS 7.0.3 Titanium SDK version 3.2.1.GA
var win1 = Titanium.UI.createWindow({ navBarHidden : true, backgroundColor : 'yellow', title : 'Yellow Window', layout : "vertical" }); var navWindow = Titanium.UI.iOS.createNavigationWindow({ window : win1 }); var win2 = Titanium.UI.createWindow({ navBarHidden : true, backgroundColor : 'red', title : 'Red Window', layout : "vertical" }); var button = Titanium.UI.createButton({ top : 100, width : 100, height : 50, color: "black", title : "Button" }); win1.add(button); win1.addEventListener("swipe", pickerSwipeHandler); win2.addEventListener("swipe", closeRedWindow); navWindow.open(); function pickerSwipeHandler(e) { if (e.direction == "left") { navWindow.openWindow(win2, { animated : true }); } } function closeRedWindow() { navWindow.closeWindow(win2, { animated : true }); }