Skip to content

Commit 0af1cb4

Browse files
author
Ian Gordon
committed
Silence some compiler / analyser comlaints
Summary: Silence a deprecated warning. Fix a missing super bug. Stop using an instance variable before initialization. Reviewers: junius, #material_components_ios_owners Reviewed By: junius, #material_components_ios_owners Projects: #material_components_ios Differential Revision: http://codereview.cc/D136
1 parent 39b3fe6 commit 0af1cb4

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

demos/Pesto/Pesto/PestoAppDelegate.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ @implementation PestoAppDelegate
1010
- (BOOL)application:(UIApplication *)application
1111
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
1212

13+
// setStatusBarHidden:withAnimation: was deprecated in iOS 9.
14+
// Silence the related warning.
15+
#pragma clang diagnostic push
16+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
1317
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO];
18+
#pragma clang diagnostic pop
1419

1520
PestoFlexibleHeaderContainerViewController *flexHeadContainerVC =
1621
[[PestoFlexibleHeaderContainerViewController alloc] init];

demos/Pesto/Pesto/PestoDetailViewController.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ - (void)viewDidLoad {
159159
}
160160

161161
- (void)viewWillAppear:(BOOL)animated {
162+
[super viewWillAppear:animated];
162163
[self loadImage];
163164
}
164165

demos/Pesto/Pesto/PestoFlexibleHeaderContainerViewController.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ - (instancetype)init {
2929
sectionInset,
3030
sectionInset,
3131
sectionInset)];
32-
_collectionViewController =
32+
PestoCollectionViewController *collectionVC =
3333
[[PestoCollectionViewController alloc] initWithCollectionViewLayout:layout];
34-
self = [super initWithContentViewController:_collectionViewController];
34+
self = [super initWithContentViewController:collectionVC];
3535
if (self) {
36+
_collectionViewController = collectionVC;
3637
_collectionViewController.flexHeaderContainerVC = self;
3738
_collectionViewController.delegate = self;
3839
[self setNeedsStatusBarAppearanceUpdate];

0 commit comments

Comments
 (0)