I have 4 views on a window that I am controlling with a tabbedbar on title. Each view has a table on it, that drills down to other tables. When I show one view I am hiding the 3 views. Occasionally when I close a window on the stack I get an error.
: 2014-03-03 10:40:48.316 Lab Values ++[23487:80b] nested push animation can result in corrupted navigation bar [INFO] : 2014-03-03 10:40:48.670 Lab Values ++[23487:80b] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted. [ERROR] : The application has crashed with an uncaught exception 'NSInvalidArgumentException'. [ERROR] : Reason: [ERROR] : Can't add self as subview [ERROR] : Stack trace: [ERROR] : 0 CoreFoundation 0x04eee5c8 __exceptionPreprocess + 152 [ERROR] : 1 libobjc.A.dylib 0x049f88b6 objc_exception_throw + 44 [ERROR] : 2 CoreFoundation 0x04eee3bb +[NSException raise:format:] + 139 [ERROR] : 3 UIKit 0x017c4dfb -[UIView(Internal) _addSubview:positioned:relativeTo:] + 113 [ERROR] : 4 UIKit 0x017b89b1 -[UIView(Hierarchy) addSubview:] + 56 [ERROR] : 5 UIKit 0x01751766 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke + 1701 [ERROR] : 6 UIKit 0x017bf3ef +[UIView(Animation) performWithoutAnimation:] + 82 [ERROR] : 7 UIKit 0x01750c96 -[_UINavigationParallaxTransition animateTransition:] + 1155 [ERROR] : 8 UIKit 0x0188be4e -[UINavigationController _startCustomTransition:] + 3446 [ERROR] : 9 UIKit 0x018980c7 -[UINavigationController _startDeferredTransitionIfNeeded:] + 688 [ERROR] : 10 UIKit 0x01898cb9 -[UINavigationController __viewWillLayoutSubviews] + 57 [ERROR] : 11 UIKit 0x019d2181 -[UILayoutContainerView layoutSubviews] + 213 [ERROR] : 12 UIKit 0x12dab56f -[UILayoutContainerViewAccessibility(SafeCategory) layoutSubviews] + 50 [ERROR] : 13 UIKit 0x017c8267 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355 [ERROR] : 14 libobjc.A.dylib 0x04a0a81f -[NSObject performSelector:withObject:] + 70 [ERROR] : 15 QuartzCore 0x02fc82ea -[CALayer layoutSublayers] + 148 [ERROR] : 16 QuartzCore 0x02fbc0d4 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380 [ERROR] : 17 QuartzCore 0x02fbbf40 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26 [ERROR] : 18 QuartzCore 0x02f23ae6 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294 [ERROR] : 19 QuartzCore 0x02f24e71 _ZN2CA11Transaction6commitEv + 393 [ERROR] : 20 QuartzCore 0x02f25544 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92 [ERROR] : 21 CoreFoundation 0x04eb64ce __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30 [ERROR] : 22 CoreFoundation 0x04eb641f __CFRunLoopDoObservers + 399 [ERROR] : 23 CoreFoundation 0x04e94344 __CFRunLoopRun + 1076 [ERROR] : 24 CoreFoundation 0x04e93ac3 CFRunLoopRunSpecific + 467 [ERROR] : 25 CoreFoundation 0x04e938db CFRunLoopRunInMode + 123 [ERROR] : 26 GraphicsServices 0x051489e2 GSEventRunModal + 192 [ERROR] : 27 GraphicsServices 0x05148809 GSEventRun + 104 [ERROR] : 28 UIKit 0x0175dd3b UIApplicationMain + 1225 [ERROR] : 29 Lab Values ++ 0x00005868 main + 456 [ERROR] : 30 libdyld.dylib 0x05ada70d start + 1 [ERROR] : 2014-03-03 10:40:51.284 Lab Values ++[23487:80b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Can't add self as subview' [ERROR]
function Window1(title) { var myFontName = Ti.App.Properties.getString('fnts'); var myFontSize = Ti.App.Properties.getInt('fntSize'); var $$ = require("ui/handheld/styles"); var win = Ti.UI.createWindow($$.window1); //win.navbarHidden = true; win.layout = 'vertical'; win.fullscreen = false; var buttonObjects = [{ image : 'images/img/panw.png', width : 45 + "dp" }, { image : 'images/img/seabw.png', width : 45 + "dp" }, { image : 'images/img/bodw.png', width : 45 + "dp" }, { image : 'images/img/prow.png', width : 45 + "dp" }]; var tb4 = Ti.UI.iOS.createTabbedBar({ labels : buttonObjects, backgroundColor : 'white', style : Titanium.UI.iPhone.SystemButtonStyle.BAR, height : 30 + "dp", width : 180 + "dp" }); win.titleControl = tb4; // win.add(tb4); tb4.index = 1; var rBtn2 = Ti.UI.createButton({ backgroundImage : 'images/image/clip@2x.png', height : 20 + "dp", width : 20 + "dp" }); win.setRightNavButton(rBtn2); rBtn2.addEventListener('click', function(_e) { var DetailWindow = require('ui/common/main/favs1'); win.containingTab.open(new DetailWindow()); }); var sea = Ti.UI.createView($$.vw); var sys = Ti.UI.createView($$.vw); var pan = Ti.UI.createView($$.vw); var pro = Ti.UI.createView($$.vw); function winSea() { } winSea(); function winSys() { } winSys(); function winPan() { } winPan(); function winPro() { } winPro(); var container = Ti.UI.createView($$.vw); win.add(container); container.add(pro); container.add(pan); container.add(sys); container.add(sea); tb4.addEventListener('click', function(e) { switch(e.index) { case 0: pan.show(); sys.hide(); sea.hide(); pro.hide(); buttonObjects[0].image = 'images/img/panb.png'; buttonObjects[1].image = 'images/img/seaww.png'; buttonObjects[2].image = 'images/img/bodw.png'; buttonObjects[3].image = 'images/img/bodw.png'; tb4.labels = buttonObjects; break; case 1: pan.hide(); sys.hide(); sea.show(); pro.hide(); buttonObjects[0].image = 'images/img/panw.png'; buttonObjects[1].image = 'images/img/seabw.png'; buttonObjects[2].image = 'images/img/bodw.png'; buttonObjects[3].image = 'images/img/bodw.png'; tb4.labels = buttonObjects; break; case 2: pan.hide(); sys.show(); sea.hide(); pro.hide(); buttonObjects[0].image = 'images/img/panw.png'; buttonObjects[1].image = 'images/img/seaww.png'; buttonObjects[2].image = 'images/img/bodb.png'; buttonObjects[3].image = 'images/img/bodw.png'; tb4.labels = buttonObjects; break; case 3: pan.hide(); sys.hide(); sea.hide(); pro.show(); buttonObjects[0].image = 'images/img/panw.png'; buttonObjects[1].image = 'images/img/seaww.png'; buttonObjects[2].image = 'images/img/bodb.png'; buttonObjects[3].image = 'images/img/bodw.png'; tb4.labels = buttonObjects; break; } }); return win; } module.exports = Window1;