From fe8e721fbeeaa802b0a3c3092d6d3e6d758cf583 Mon Sep 17 00:00:00 2001 From: Grant Paul Date: Wed, 2 Feb 2011 00:11:55 -0800 Subject: Added session persistence; moved -init to -loadView, -viewDidLoad, etc; added releasing of views in low-memory situations; style changes. --- UICaboodle/RVPage.mm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'UICaboodle/RVPage.mm') 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 -- cgit v1.2.3