Permalink
Browse files

Add a few missing calls to super in the iOS sample project

  • Loading branch information...
1 parent 4461312 commit 12b98e3d044b47f34a3346ffac272e64307cb4f2 @tonyarnold tonyarnold committed Nov 1, 2014
@@ -53,6 +53,8 @@ @implementation InstructionsViewController
- (void)viewDidLoad {
+ [super viewDidLoad];
+
UINavigationItem *navigationItem = self.navigationItem;
navigationItem.title = @"Instructions";
self.navigationItem.rightBarButtonItem = self.editButtonItem;
@@ -62,11 +64,14 @@ - (void)viewDidLoad {
- (void)viewDidUnload {
self.instructionsText = nil;
self.nameLabel = nil;
+
[super viewDidUnload];
}
-- (void)viewWillAppear:(BOOL)animated {
+- (void)viewWillAppear:(BOOL)animated {
+ [super viewWillAppear:animated];
+
// Update the views appropriately
self.nameLabel.text = self.recipe.name;
self.instructionsText.text = self.recipe.instructions;
@@ -53,7 +53,8 @@ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
@implementation RecipeAddViewController
- (void)viewDidLoad {
-
+ [super viewDidLoad];
+
// Configure the navigation bar
self.navigationItem.title = @"Add Recipe";
@@ -69,6 +70,7 @@ - (void)viewDidLoad {
- (void)viewDidUnload {
self.nameTextField = nil;
+
[super viewDidUnload];
}
@@ -124,6 +124,8 @@ - (void)reloadRecipe:(NSNotification*)note {
- (void)viewDidLoad {
+ [super viewDidLoad];
+
self.navigationItem.rightBarButtonItem = self.editButtonItem;
// Create and set the table header view.
@@ -79,6 +79,8 @@ - (void)reloadFetchedResults:(NSNotification*)note {
}
- (void)viewDidLoad {
+ [super viewDidLoad];
+
// Configure the navigation bar
self.title = @"Recipes";
@@ -99,6 +101,8 @@ - (void)viewDidLoad {
// clean up our new observers
- (void)viewDidUnload {
[[NSNotificationCenter defaultCenter] removeObserver:self];
+
+ [super viewDidUnload];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
@@ -55,6 +55,8 @@ @implementation RecipePhotoViewController
- (void)loadView {
+ [super loadView];
+
self.title = @"Photo";
_imageView = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
@@ -67,6 +69,8 @@ - (void)loadView {
- (void)viewWillAppear:(BOOL)animated {
+ [super viewWillAppear:animated];
+
_imageView.image = [_recipe.image valueForKey:@"image"];
}
@@ -59,14 +59,17 @@ @implementation TemperatureConverterViewController
#pragma mark -
#pragma mark View lifecycle
-- (void)viewDidLoad {
+- (void)viewDidLoad {
+ [super viewDidLoad];
+
self.title = @"Temperature";
self.tableView.allowsSelection = NO;
}
- (void)viewDidUnload {
self.tableView = nil;
+
[super viewDidUnload];
}

0 comments on commit 12b98e3

Please sign in to comment.