I’m working on an iPhone application. I’m using Storyboard.
I wanted to have one object attached to the NavController to handle the visibility of the button bar at the bottom of windows that display table views.
I created my own UINavigationDelegate; MyNavigationControllerDelegate.
I have created an NSObject in UIBuilder and changed its class MyNavigationControllerDelegate. And then attached it as the delegate of the UINavigationController.

For some reason MyNavigationControllerDelegate is getting deallocated. I would have thought that being the delegate would be enough to keep a reference to it and prevent deallocation, but that seems not to be the case.
Any suggestions as to how to prevent it from being deallocated? And do I have to reset it as the delegate each time a view is loaded?
The
delegateproperty of UINavigationController is declared asassignrather thanretainorstrong(see here). Delegates are typically declared eitherweakorassign, which means assigning the property will not cause theUINavigationControllerto increase the reference count on your delegate, and you need another object to hold a strong reference to it (perhaps your RootViewController).