From 5c4b44c6a3514e7c47c3b2ce79972b13e6ee71be Mon Sep 17 00:00:00 2001 From: Soutaro Matsumoto Date: Fri, 17 Jun 2016 17:57:23 +0900 Subject: [PATCH] Fix nullarihyon warnings --- Obihiro/OBHAlertControllerObject.m | 2 +- Obihiro/OBHViewControllerObject.m | 8 ++++---- Obihiro/UIViewController+OBH.m | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Obihiro/OBHAlertControllerObject.m b/Obihiro/OBHAlertControllerObject.m index 7ddd0b4..45725b9 100644 --- a/Obihiro/OBHAlertControllerObject.m +++ b/Obihiro/OBHAlertControllerObject.m @@ -15,7 +15,7 @@ - (nullable NSString *)alertMessage { - (NSArray *)buttonTitles { NSArray *actions = self.viewController.actions; - NSMutableArray *titles = [NSMutableArray new]; + NSMutableArray *titles = [[NSMutableArray alloc] init]; for (UIAlertAction *action in actions) { NSString *title = action.title; diff --git a/Obihiro/OBHViewControllerObject.m b/Obihiro/OBHViewControllerObject.m index 00b7b0a..b0d289f 100644 --- a/Obihiro/OBHViewControllerObject.m +++ b/Obihiro/OBHViewControllerObject.m @@ -50,9 +50,9 @@ - (instancetype)initWithViewController:(UIViewController *)viewController parent self.defaultTimeout = 0.4; if (!self.parentObject) { - self.objectRefs = [NSMutableArray new]; + self.objectRefs = [[NSMutableArray alloc] init]; } - self.classRegistory = [NSMutableDictionary new]; + self.classRegistory = [[NSMutableDictionary alloc] init]; [self initializeObject]; @@ -99,7 +99,7 @@ - (void)registerObjectClass:(Class)objectClass { - (NSArray *)childObjectsOfViewControllerClass:(Class)klass { [self ensureAllViewsDidAppear]; - NSMutableArray<__kindof OBHViewControllerObject *> *childObjects = [NSMutableArray new]; + NSMutableArray<__kindof OBHViewControllerObject *> *childObjects = [[NSMutableArray alloc] init]; for (UIViewController *viewController in self.viewController.childViewControllers) { if ([viewController isKindOfClass:klass]) { @@ -176,7 +176,7 @@ - (UIView *)view { } - (NSArray *)descendantViewsOfClass:(Class)klass { - NSMutableArray *array = [NSMutableArray new]; + NSMutableArray *array = [[NSMutableArray alloc] init]; [self addViews:self.view class:klass toArray:array]; return array; } diff --git a/Obihiro/UIViewController+OBH.m b/Obihiro/UIViewController+OBH.m index bbd0280..1b5e343 100644 --- a/Obihiro/UIViewController+OBH.m +++ b/Obihiro/UIViewController+OBH.m @@ -3,6 +3,8 @@ #import #import +NS_ASSUME_NONNULL_BEGIN + NSUInteger OBHAppearingViewControllerCount = 0; @implementation UIViewController (OBH) @@ -57,3 +59,5 @@ - (void)viewDidDisappearWithNotification:(BOOL)animated { } @end + +NS_ASSUME_NONNULL_END