Calling push methods of a subclass of UINavigationBar not called

I will subclass UINavigationBar because I need iOS 7 to appear before iOS 5.

I have overridden the following methods:

- (void)pushNavigationItem:(UINavigationItem *)item animated:(BOOL)animated
{
    NSLog(@"pushNavigationItem:animated:");
    [super pushNavigationItem:item animated:animated];

    _titleView = item.titleView;
}

- (UINavigationItem *)popNavigationItemAnimated:(BOOL)animated
{
    NSLog(@"popNavigationItemAnimated:");
    return [super popNavigationItemAnimated:animated];
}

But they are never called (there is no output to the console and without interruptions at control points).

Everything else, including drawRect: and layoutSubviews works fine.

Am I doing something wrong or is this a bug in UIKit?

+4
source share

All Articles