diff options
Diffstat (limited to 'CyteKit/WebViewController.mm')
-rw-r--r-- | CyteKit/WebViewController.mm | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/CyteKit/WebViewController.mm b/CyteKit/WebViewController.mm index b954b8e..b59d830 100644 --- a/CyteKit/WebViewController.mm +++ b/CyteKit/WebViewController.mm @@ -598,7 +598,12 @@ float CYScrollViewDecelerationRateNormal; } - (UIBarButtonItem *) customButton { - return custom_ == [NSNull null] ? nil : [[[UIBarButtonItem alloc] + if (custom_ == nil) + return nil; + else if (custom_ == [NSNull null]) + return (UIBarButtonItem *) [NSNull null]; + + return [[[UIBarButtonItem alloc] initWithTitle:static_cast<NSString *>(custom_.operator NSObject *()) style:[self rightButtonStyle] target:self @@ -629,9 +634,13 @@ float CYScrollViewDecelerationRateNormal; } else { [indicator_ stopAnimating]; - [[self navigationItem] setRightBarButtonItem:( - custom_ != nil ? [self customButton] : [self rightButton] - ) animated:YES]; + UIBarButtonItem *button([self customButton]); + if (button == nil) + button = [self rightButton]; + else if (button == (UIBarButtonItem *) [NSNull null]) + button = nil; + + [[self navigationItem] setRightBarButtonItem:button]; } } |