I have a class structure of type UIViewControllerSubclass : UIViewController , where the only function of the UIViewControllerSubclass is #import UIViewController+Category.h . The reason I added methods to the category is because I can also make UITableViewControllerSubclass : UITableViewController , which will be #import UIViewController+Category.h . As we all know, do not repeat yourself.
Now suppose that UIViewController + Category.h has the structure:
@interface UIViewController(Category) - (void) method1; - (void) method2; @end
How safe is it to create a UIViewControllerSubclassSubclass : UIViewControllerSubclass , which will override method1 ? I suppose this will work due to the transmission of an Objective-C message, but for some reason my intuition tells me that I am doing it wrong.
objective-c objective-c-category
paulrehkugler
source share