summaryrefslogtreecommitdiff
path: root/CyteKit
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-02 08:46:28 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-07 02:41:34 -0800
commit297566744d63fffb6f2023cd58de7d4b0300a95f (patch)
treee754c81bf752a149b52f5b6932aa7280adfa94f6 /CyteKit
parentd53628b6a4db45ae954921570124a646e027b086 (diff)
Fit ManageController to CyteWebViewController {custom,right}Button API.
Diffstat (limited to 'CyteKit')
-rw-r--r--CyteKit/WebViewController.h1
-rw-r--r--CyteKit/WebViewController.mm17
2 files changed, 14 insertions, 4 deletions
diff --git a/CyteKit/WebViewController.h b/CyteKit/WebViewController.h
index d2f9fb5..db40a1c 100644
--- a/CyteKit/WebViewController.h
+++ b/CyteKit/WebViewController.h
@@ -125,6 +125,7 @@
- (void) customButtonClicked;
- (void) applyRightButton;
+- (UIBarButtonItem *) customButton;
- (UIBarButtonItem *) rightButton;
- (void) _didStartLoading;
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];
}
}