Skip to content

Commit

Permalink
Fix nullarihyon warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
soutaro committed Jun 17, 2016
1 parent ad56c31 commit 5c4b44c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Obihiro/OBHAlertControllerObject.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ - (nullable NSString *)alertMessage {
- (NSArray<NSString *> *)buttonTitles {
NSArray<UIAlertAction *> *actions = self.viewController.actions;

NSMutableArray *titles = [NSMutableArray new];
NSMutableArray *titles = [[NSMutableArray alloc] init];

for (UIAlertAction *action in actions) {
NSString *title = action.title;
Expand Down
8 changes: 4 additions & 4 deletions Obihiro/OBHViewControllerObject.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down Expand Up @@ -99,7 +99,7 @@ - (void)registerObjectClass:(Class)objectClass {
- (NSArray<OBHViewControllerObject *> *)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]) {
Expand Down Expand Up @@ -176,7 +176,7 @@ - (UIView *)view {
}

- (NSArray<UIView *> *)descendantViewsOfClass:(Class)klass {
NSMutableArray<UIView *> *array = [NSMutableArray new];
NSMutableArray<UIView *> *array = [[NSMutableArray alloc] init];
[self addViews:self.view class:klass toArray:array];
return array;
}
Expand Down
4 changes: 4 additions & 0 deletions Obihiro/UIViewController+OBH.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#import <UIKit/UIKit.h>
#import <objc/runtime.h>

NS_ASSUME_NONNULL_BEGIN

NSUInteger OBHAppearingViewControllerCount = 0;

@implementation UIViewController (OBH)
Expand Down Expand Up @@ -57,3 +59,5 @@ - (void)viewDidDisappearWithNotification:(BOOL)animated {
}

@end

NS_ASSUME_NONNULL_END

0 comments on commit 5c4b44c

Please sign in to comment.