diff options
Diffstat (limited to 'UICaboodle')
-rw-r--r-- | UICaboodle/RVPage.h | 5 | ||||
-rw-r--r-- | UICaboodle/RVPage.mm | 27 |
2 files changed, 31 insertions, 1 deletions
diff --git a/UICaboodle/RVPage.h b/UICaboodle/RVPage.h index 1f39428..68ffb39 100644 --- a/UICaboodle/RVPage.h +++ b/UICaboodle/RVPage.h @@ -4,8 +4,11 @@ @interface CYViewController : UIViewController { id delegate_; + BOOL loaded_; } -- (void)setDelegate:(id)delegate; +- (NSURL *)navigationURL; +- (void) setDelegate:(id)delegate; - (void) reloadData; +- (void) releaseSubviews; @end diff --git a/UICaboodle/RVPage.mm b/UICaboodle/RVPage.mm index 81c8739..d3de6d3 100644 --- a/UICaboodle/RVPage.mm +++ b/UICaboodle/RVPage.mm @@ -6,12 +6,39 @@ #import "RVBook.h" @implementation CYViewController + - (void) setDelegate:(id)delegate { delegate_ = delegate; } + +- (void) viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + + if (!loaded_) + [self reloadData]; +} + +- (void) releaseSubviews { + // Do nothing. +} + +- (void) setView:(UIView *)view { + if (view == nil) + [self releaseSubviews]; + + [super setView:view]; +} + - (void) reloadData { + loaded_ = YES; } + +- (NSURL *) navigationURL { + return nil; +} + - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation { return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad || orientation == UIInterfaceOrientationPortrait); } + @end |