I'm currently building a tabbed iPhone application where each tab's view controller is an instance of UINavigationController
, and where every subcontroller of every one of the UINavigationController
instances is an instance of UITableViewController
. Ideally, I'd like to subclass UINavigationController
so that the controller for each tab is a subclass of UINavigationController that (in addition to having all the standard UINavigationController
functionality, obviously) serves as the datasource and the delegate for each of the table views associated with its subcontrollers. Trying to do this seems to break the basic UINavigationController
functionality in the subclass.
Seeing as Apple says in their iPhone documentation that one shouldn't subclass UINavigationController
, and things seem to break when one does, I'm wondering how I should go about extending UINavigationController's
functionality without subclassing, and generally speaking, how one should work around subclassing limitations when doing Cocoa development.
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…